|
From: C M <cmp...@gm...> - 2014-12-31 19:09:26
|
On Wed, Dec 31, 2014 at 9:45 AM, Benjamin Root <ben...@ou...> wrote: > What might be happening is that the patch being added has no area. The > logic it is failing in is in the autoscaling section, I believe. This is > why if there are other things already in the plot or with other patches, > then the code works fine because the limits aren't identical. > If it is helpful, when I print the value of the patch, I get this: patch is: Poly((735597, -12) ...) What's weird though, is that the other plot I'm talking about is a *different* plot entirely (different canvas instance), and can be closed first and still "allow" the patch plot to be shown without errors. > > Still though, I thought we had enough logic checks to prevent this sort of > error. I see you are using Python 2.5, which is older than what we > currently support. Which version of matplotlib are you using? > I'm using matplotlib 1.1.0. I could try upgrading. > > Cheers! > Ben Root > > > On Wed, Dec 31, 2014 at 2:03 AM, C M <cmp...@gm...> wrote: > >> I have no idea what this is. If I create a certain plot first in an >> application, it throws this error (edited to the key part): >> >> Traceback (most recent call last): >> >> File "thescript.py", line 2147, in AddPatchBar >> ax.add_patch(patch) >> File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1471, in >> add_patch >> self._update_patch_limits(p) >> File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1492, in >> _update_patch_limits >> self.transData.inverted()) >> File "C:\Python25\lib\site-packages\matplotlib\transforms.py", line >> 1954, in inverted >> return CompositeGenericTransform(self._b.inverted(), >> self._a.inverted()) >> File "C:\Python25\lib\site-packages\matplotlib\transforms.py", line >> 1448, in inverted >> self._inverted = Affine2D(inv(mtx)) >> File "C:\Python25\lib\site-packages\numpy\linalg\linalg.py", line 445, >> in inv >> return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) >> File "C:\Python25\lib\site-packages\numpy\linalg\linalg.py", line 328, >> in solve >> raise LinAlgError, 'Singular matrix' >> numpy.linalg.linalg.LinAlgError: Singular matrix >> >> But, the odd part is that if I create a completely different and totally >> separate plot *before* this one, and *then* I try to plot this one, I do >> not get this error and this plot shows fine. That makes no sense to me. Or >> also, if I plot this "patch" on a plot with a few other lines plotted, it >> also works. >> >> Does anyone have any idea what could be causing this? Thanks. >> >> >> >> ------------------------------------------------------------------------------ >> Dive into the World of Parallel Programming! The Go Parallel Website, >> sponsored by Intel and developed in partnership with Slashdot Media, is >> your >> hub for all things parallel software development, from weekly thought >> leadership blogs to news, videos, case studies, tutorials and more. Take a >> look and join the conversation now. http://goparallel.sourceforge.net >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |