Re: [matplotlib-devel] Patch for making SpanSelector usable in embedded matplotlib

2008-02-12 Thread Erik Tollerud
While doing some further testing, I'm getting another bug in the svn
code - whenever I try to right-click and drag to zoom out when using
the toolbar, an Exception is raised complaining about an unbound
local.  I traced the problem to what appears to be a typo in
backend_bases.py where someone must have renamed some variables and
didn't go and change them further up or something.  Changing the
variable name in a couple places seems to make it all work on my
setup.  The diff is attached.

On Feb 12, 2008 6:11 PM, John Hunter <[EMAIL PROTECTED]> wrote:
> On Feb 12, 2008 7:02 PM, Erik Tollerud <[EMAIL PROTECTED]> wrote:
> > You're absolutely correct - I wrote the original patch against 91.2,
> > and forgot to test it against the new trunk.  Below is a new patch
> > that HAS been tested against the trunk version.  It includes another
> > fix for some API changes in the Rectangle object.  Note that there's
> > also a fix in the RectangleSelector to prevent it from raising an
> > exception under the new API.
>
> OK, thanks Erik, I committed this to the trunk as svn r4956.  It seems
> to be working fine, so thanks for the patch.  I'm not sure right now
> wha the problem is with useblit=False that you are experiencing, but
> if you make any headway on this let us know.
>
> JDH
>
> -
> 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-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>



-- 
Erik Tollerud
Graduate Student
Center For Cosmology
Department of Physics and Astronomy
4155B Frederick Reines Hall
University of California, Irvine
Office Phone: (949)824-2996
Cell: (651)307-9409
[EMAIL PROTECTED]
Index: backend_bases.py
===
--- backend_bases.py	(revision 4957)
+++ backend_bases.py	(working copy)
@@ -1556,11 +1556,11 @@
 if a.get_xscale()=='log':
 alpha=npy.log(Xmax/Xmin)/npy.log(x1/x0)
 rx1=pow(Xmin/x0,alpha)*Xmin
-x2=pow(Xmax/x0,alpha)*Xmin
+rx2=pow(Xmax/x0,alpha)*Xmin
 else:
 alpha=(Xmax-Xmin)/(x1-x0)
 rx1=alpha*(Xmin-x0)+Xmin
-x2=alpha*(Xmax-x0)+Xmin
+rx2=alpha*(Xmax-x0)+Xmin
 if a.get_yscale()=='log':
 alpha=npy.log(Ymax/Ymin)/npy.log(y1/y0)
 ry1=pow(Ymin/y0,alpha)*Ymin
-
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch for making SpanSelector usable in embedded matplotlib

2008-02-12 Thread John Hunter
On Feb 12, 2008 7:02 PM, Erik Tollerud <[EMAIL PROTECTED]> wrote:
> You're absolutely correct - I wrote the original patch against 91.2,
> and forgot to test it against the new trunk.  Below is a new patch
> that HAS been tested against the trunk version.  It includes another
> fix for some API changes in the Rectangle object.  Note that there's
> also a fix in the RectangleSelector to prevent it from raising an
> exception under the new API.

OK, thanks Erik, I committed this to the trunk as svn r4956.  It seems
to be working fine, so thanks for the patch.  I'm not sure right now
wha the problem is with useblit=False that you are experiencing, but
if you make any headway on this let us know.

JDH

-
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] fix for "errorbar" method skipping over plot color cycle

2008-02-12 Thread Erik Tollerud
After a little testing on the subversion repository, the attached diff
seems to work.

On Feb 10, 2008 12:12 AM, Erik Tollerud <[EMAIL PROTECTED]> wrote:
> I noticed while making some plots with upper bound error bars that
> whenever Axes.errorbars is called with any of the errorbars chosen as
> upper or lower bounds, that the color cycle was off, skipping over 2
> colors each time another errorbar plot was made (e.g. the first would
> be green and the second would be cyan instead of blue,green,red,cyan).
> Looking into the axes class, it appears that if you don't specify a
> color and want the markers to be drawn over the errorbars, the color
> cycle has already been skipped over one because of calls to draw the
> markers into the plot.  The solution is to change all the lines that
> say " ls='None' " in the errorbar method to instead say " ls='k' " -
> this will prevent those calls from cycling the colors, and hence only
> the call to actually draw the markers will do so.  Can this patch be
> committed to svn?
>



-- 
Erik Tollerud
Graduate Student
Center For Cosmology
Department of Physics and Astronomy
4155B Frederick Reines Hall
University of California, Irvine
Office Phone: (949)824-2996
Cell: (651)307-9409
[EMAIL PROTECTED]
Index: axes.py
===
--- axes.py	(revision 4957)
+++ axes.py	(working copy)
@@ -3880,7 +3880,7 @@
 # y are lists
 leftlo, ylo = xywhere(left, y, xlolims)
 
-caplines.extend( self.plot(leftlo, ylo, ls='None', marker=mlines.CARETLEFT, **plot_kw) )
+caplines.extend( self.plot(leftlo, ylo, 'k|', marker=mlines.CARETLEFT, **plot_kw) )
 xlolims = ~xlolims
 leftlo, ylo = xywhere(left, y, xlolims)
 caplines.extend( self.plot(leftlo, ylo, 'k|', **plot_kw) )
@@ -3890,7 +3890,7 @@
 if xuplims.any():
 
 rightup, yup = xywhere(right, y, xuplims)
-caplines.extend( self.plot(rightup,  yup, ls='None', marker=mlines.CARETRIGHT, **plot_kw) )
+caplines.extend( self.plot(rightup,  yup, 'k|', marker=mlines.CARETRIGHT, **plot_kw) )
 xuplims = ~xuplims
 rightup, yup = xywhere(right, y, xuplims)
 caplines.extend( self.plot(rightup,  yup, 'k|', **plot_kw) )
@@ -3912,7 +3912,7 @@
 
 if lolims.any():
 xlo, lowerlo = xywhere(x, lower, lolims)
-caplines.extend( self.plot(xlo, lowerlo, ls='None', marker=mlines.CARETDOWN, **plot_kw) )
+caplines.extend( self.plot(xlo, lowerlo, 'k_', marker=mlines.CARETDOWN,  **plot_kw) )
 lolims = ~lolims
 xlo, lowerlo = xywhere(x, lower, lolims)
 caplines.extend( self.plot(xlo, lowerlo, 'k_', **plot_kw) )
@@ -3922,7 +3922,7 @@
 if uplims.any():
 xup, upperup = xywhere(x, upper, uplims)
 
-caplines.extend( self.plot(xup, upperup, ls='None', marker=mlines.CARETUP, **plot_kw) )
+caplines.extend( self.plot(xup, upperup, 'k_', marker=mlines.CARETUP, **plot_kw) )
 uplims = ~uplims
 xup, upperup = xywhere(x, upper, uplims)
 caplines.extend( self.plot(xup, upperup, 'k_', **plot_kw) )
-
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel