plot([], [], drawstyle = 'steps') fails

Hi all,

sorry, only reporting, no bugfix. I just discovered that an empty plot with drawstyle 'steps', 'steps-pre', 'steps-mid' and 'steps-post' fails. I am using matplotlib 0.98.5.2.

Example

plot([], [], drawstyle = 'steps')

...
C:\Python25\lib\site-packages\matplotlib\lines.pyc in _draw_steps_pre(self, renderer, gc, path, trans)
    784 def _draw_steps_pre(self, renderer, gc, path, trans):
    785 vertices = self._xy
--> 786 steps = ma.zeros((2*len(vertices)-1, 2), np.float_)
    787
    788 steps[0::2, 0], steps[1::2, 0] = vertices[:, 0], vertices[:-1, 0
]
...

ValueError: negative dimensions are not allowed

Gregor

This is now fixed in SVN. Thanks for the report.

Mike

Gregor Thalhammer wrote:

···

Hi all,

sorry, only reporting, no bugfix. I just discovered that an empty plot with drawstyle 'steps', 'steps-pre', 'steps-mid' and 'steps-post' fails. I am using matplotlib 0.98.5.2.

Example

plot([], [], drawstyle = 'steps')

...
C:\Python25\lib\site-packages\matplotlib\lines.pyc in _draw_steps_pre(self, renderer, gc, path, trans)
    784 def _draw_steps_pre(self, renderer, gc, path, trans):
    785 vertices = self._xy
--> 786 steps = ma.zeros((2*len(vertices)-1, 2), np.float_)
    787
    788 steps[0::2, 0], steps[1::2, 0] = vertices[:, 0], vertices[:-1, 0
]
...

ValueError: negative dimensions are not allowed

Gregor

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA