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

Conversation

Projects
None yet
2 participants
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
Member

WeatherGod commented Jul 10, 2012

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

Member

WeatherGod commented Jul 10, 2012

Congrats on getting the 1000th issue, btw.

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.

Contributor

dhyams commented Jul 10, 2012

Fix added for hlines as well.

Member

WeatherGod commented Jul 10, 2012

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.

Contributor

dhyams commented Jul 10, 2012

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

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.

Member

WeatherGod commented Jul 10, 2012

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

@WeatherGod WeatherGod added a commit that referenced this pull request Jul 10, 2012

@WeatherGod WeatherGod Merge pull request #1000 from dhyams/fix_vlines
Fix traceback for vlines/hlines, when an empty list or array passed in for x/y.
f6b7f28

@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