8000 Fix ValueError being raised when plotting hist and hexbin on empty dataset (Fix #3886) by umairidris · Pull Request #4119 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix ValueError being raised when plotting hist and hexbin on empty dataset (Fix #3886) #4119

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

Merged
merged 7 commits into from
Mar 30, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add explanation for test_hist_empty
  • Loading branch information
Umair Idris committed Feb 17, 2015
commit 6deba68600fb28b50b4ab65cb2cc9dce67110827
3 changes: 2 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def test_hexbin_extent():
ax.hexbin(x, y, extent=[.1, .3, .6, .7])

def test_hexbin_empty():
# From #3886: creating hexbin on empty dataset raises ValueError
# From #3886: creating hexbin from empty dataset raises ValueError
ax.hexbin([], [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to create the Axes first. Also, I think you will want to use the @cleanup decorator.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is now done via commit cb8539f.


@cleanup
Expand Down Expand Up @@ -1006,6 +1006,7 @@ def test_hist_log():


def test_hist_empty():
# From #3886: creating hist from empty dataset raises ValueError
ax.hist([])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for the other test.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


@image_comparison(baseline_images=['hist_steplog'], remove_text=True)
Expand Down
0