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.
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?
Cheers!
Ben Root
On Wed, Dec 31, 2014 at 2:03 AM, C M <cmpyt...@gmail.com> 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
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
------------------------------------------------------------------------------
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users