[Matplotlib-users] PS backend does not respect kwargs

2008-02-01 Thread pnovak
When using the PostScript backend, and plotting several lines with the same 
call to plot (or when plotting a LineCollection), kwargs are applied to the 
first line only, and not to every line.

Included is a minimal script that exhibits this problem. The saved figure shows 
only one thick red line where we would expect two such lines.

Paul Novak

#!/usr/bin/env python

import matplotlib
matplotlib.use('PS')
from pylab import *

x = arange(0.0, 5.0)
y = 2 * x
plot(x, x, x, y, color='red', linewidth = 5)

savefig('image')

show()

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] PATCH legend(numpoints = 0)

2008-02-01 Thread pnovak
Included is a patch to change the behavior when legend() is called with 
numpoints less than or equal to 0. Currently if one makes such a call, some 
cryptic error messages are printed out and the plot is not generated.

The included patch produces a warning, and defaults to using numpoints = 4, so 
the plot is actually made.

Paul Novak

---
--- legend.py   2008-02-01 19:14:24.0 -0600
+++ legend.py   2008-02-01 19:13:55.0 -0600
@@ -166,6 +166,12 @@
 
 self._loc = loc
 
+if self.numpoints = 0:
+warnings.warn('legend() called with numpoints = %d. '
+  'Default to numpoints = 4 because numpoints must be 
greater than zero.' \
+  % (self.numpoints))
+self.numpoints = 4
+
 self.legendPatch = Rectangle(
 xy=(0.0, 0.0), width=0.5, height=0.5,
 facecolor='w', edgecolor='k',

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users