Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

dhyams
Copy link
Contributor

@dhyams 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.

…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
@WeatherGod
Copy link
Member

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

@WeatherGod
Copy link
Member

Congrats on getting the 1000th issue, btw.

@dhyams
Copy link
Contributor Author

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
Copy link
Contributor Author

dhyams commented Jul 10, 2012

Fix added for hlines as well.

@WeatherGod
Copy link
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
Copy link
Contributor Author

dhyams commented Jul 10, 2012

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

@dhyams
Copy link
Contributor Author

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
Copy link
Member

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

WeatherGod added a commit that referenced this pull request Jul 10, 2012
Fix traceback for vlines/hlines, when an empty list or array passed in for x/y.
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants