Fix traceback for vlines/hlines, when an empty list or array passed in for x/y. #1000

Merged
merged 3 commits into from Jul 10, 2012

Projects

None yet

2 participants

@dhyams
Contributor
dhyams commented Jul 10, 2012

Handle the edge case in matplotlib.axes.vlines and matplotlib.axes.hlines where an empty list or array is passed in as x (or y). Previously, the vlines/hlines routines would raise an exception when min() was called, if x (or y) was an empty list.

@dhyams dhyams Handle the edge case in matplotlib.axes.vlines, where an empty list o…
…r array is passed in as x. Previously,

the vlines routine would raise an exception when min(x) was called, if x was an empty list.wq
8f50a76
@WeatherGod
Member

I presume the same should be done for hlines() as well?

@WeatherGod
Member

Congrats on getting the 1000th issue, btw.

@dhyams
Contributor
dhyams commented Jul 10, 2012

Re: for hlines...yes...I presume so. I forgot that matplotlib supported hlines :/

I'll check it and perform the same change there for this pull request.

@dhyams
Contributor
dhyams commented Jul 10, 2012

Fix added for hlines as well.

@WeatherGod
Member

Thanks for that. My only other concern is what happens if the length of the input array is one. I am pretty sure update_datalim() is smart about this, but I can't remember off the top of my head.

@dhyams
Contributor
dhyams commented Jul 10, 2012

Re: 1000th issue: Is there a door prize? ;)

@dhyams
Contributor
dhyams commented Jul 10, 2012

Re: update_datalim(): Just in the last few days, I have had a plot or two that had a single point with error bars. The autoscaling seemed to work fine, so I think update_datalim() is OK with just one point.

@WeatherGod
Member

Re: door prize: Yeah, you get a free PR merge. Congrats!

@WeatherGod WeatherGod merged commit f6b7f28 into matplotlib:master Jul 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment