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

Fixed ErrorBarPlot mpl2.0 compat and made it more general #1131

Merged
merged 1 commit into from
Feb 23, 2017

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Feb 13, 2017

ErrorBars were one of the only failures in our compatibility with mpl 2.0, the difference is that errorbar caps are disabled by default and that the return signature differs. This adds that compatibility and also made the plot correctly animate ErrorBar plots with varying numbers of error bars and adds support for inverting axes on the plot allowing it to be adjoined correctly.

_, (bottoms, tops), verts = ax.errorbar(*plot_data, **plot_kwargs)
handles = ax.errorbar(*plot_data, **plot_kwargs)
bottoms, tops = None, None
if mpl_version >= str('2.0'):
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is the only bit that changes specifically for matplotlib 2.0+?

Copy link
Member Author

Choose a reason for hiding this comment

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

No the update code also had to change because the caps aren't instantiated by default.

@philippjfr
Copy link
Member Author

Tests appear to be failing because this display output 46 in Elements has changed. Here is what it looks like:

image

What that has to do with errorbars I do not know.

@jlstevens
Copy link
Contributor

Wow..that is a pretty strange side-effect! Definitely no error bars there!

@philippjfr
Copy link
Member Author

So I'm super confused now, the test above is meant to look like this:

image

Why would annotations disappear after fixing a completely different plot?

@philippjfr
Copy link
Member Author

philippjfr commented Feb 23, 2017

Figured it out, this is why * imports are bad. The import of Path from matplotlib is getting imported into mpl/__init__.py which ends up overriding our registration of hv.Path, so paths never end up getting plotted.

@jlstevens
Copy link
Contributor

The import of Path from matplotlib is getting imported into mpl/init.py which ends up overriding our registration of hv.Path, so paths never end up getting plotted.

Ha! Yes, let's not use glob imports.

Anyway, now that is resolved, this PR looks fine and the tests have passed without needing to be updated. Merging.

@jlstevens jlstevens merged commit 885c1bc into master Feb 23, 2017
@philippjfr philippjfr deleted the errorbars_fix branch February 27, 2017 23:29
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants