axvspan/axhspan doesn't understand keyword arguments

I ran into a little problem when adding an axis span (both vertical and horizontal) to my plot. When I use the optional keyword arguments, I get an error message:

import pylab
pylab.axhspan(0.25, 0.75, facecolor=‘0.5’, alpha=0.5)
Traceback (most recent call last):
File “”, line 1, in
File “/lib/python2.5/site-packages/matplotlib/pyplot.py”, line 1572, in axhspan
ret = gca().axhspan(*args, **kwargs)
File “/lib/python2.5/site-packages/matplotlib/axes.py”, line 2883, in axhspan
self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs )
TypeError: _process_unit_info() got an unexpected keyword argument ‘alpha’

Granted, I can get the results I want using the .set_xxx() methods, but my first method should have worked, right?

I’ve never filed a bug for matplotlib before, so I figured I’d send out an email to the users-group first.

Thanks,
Sara

Sara Hatch wrote:

I ran into a little problem when adding an axis span (both vertical and horizontal) to my plot. When I use the optional keyword arguments, I get an error message:

import pylab
pylab.axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/python2.5/site-packages/matplotlib/pyplot.py", line 1572, in axhspan
    ret = gca().axhspan(*args, **kwargs)
  File "/lib/python2.5/site-packages/matplotlib/axes.py", line 2883, in axhspan
    self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs )
TypeError: _process_unit_info() got an unexpected keyword argument 'alpha'

Granted, I can get the results I want using the .set_xxx() methods, but my first method should have worked, right?

I've never filed a bug for matplotlib before, so I figured I'd send out an email to the users-group first.

Sara,

Thank you, that is indeed the right thing to do. In addition, please state what matplotlib version you are using. Often, although not in this case, it is also critical to know what operating system you are using, and the numpy version.

You have definitely hit a bug, but it has been fixed--I don't see it in svn. I don't know how long ago it was fixed. A new release of mpl has just come out. Can you upgrade?

Eric

···

Thanks,
Sara

------------------------------------------------------------------------

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options