[matplotlib-devel] legend.py "ValueError: numpoints must be >= 0; it was 0"

2011-05-14 Thread Steve Ward
>
> import matplotlib.pyplot as plt
> fig = plt.figure()
> ax = plt.subplot(1,1,1)
> ax.plot(1.1, 2.2, label='foo')
> ax.legend(numpoints=0)
> # ValueError: numpoints must be >= 0; it was 0
>

In legend.__init__ the exception message doesn't match the condition that
raises it.  I think it should say "numpoints must be > 0".  I'm using
matplotlib version 0.99.3.


Steve
Index: legend.py
===
--- legend.py	(revision 8988)
+++ legend.py	(working copy)
@@ -282,7 +282,7 @@
 self._ncol = ncol
 
 if self.numpoints <= 0:
-raise ValueError("numpoints must be >= 0; it was %d"% numpoints)
+raise ValueError("numpoints must be > 0; it was %d"% numpoints)
 
 # introduce y-offset for handles of the scatter plot
 if scatteryoffsets is None:
--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] legend.py "ValueError: numpoints must be >= 0; it was 0"

2011-05-19 Thread Steve Ward
In legend.__init__ the exception message doesn't match the condition
that raises it.  I think it should say "numpoints must be > 0".  I'm
using matplotlib version 0.99.3.

Example:
#
import matplotlib.pyplot as plt
ax = plt.subplot(1,1,1)
ax.plot(1.1, 2.2, label='foo')
ax.legend(numpoints=0)
#
# ValueError: numpoints must be >= 0; it was 0


Steve

--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel