Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecate BrokenBarHCollection. #24864

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 1 commit into from
Jan 6, 2023
Merged

Deprecate BrokenBarHCollection. #24864

merged 1 commit into from
Jan 6, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 1, 2023

It doesn't warrant a separate class; also, directly doing the unit conversion in broken_barh is actually easier (one doesn't need to go through _convert_dx, instead we directly move to using xmin/xmax).

Closes #15973 (... by making the user use fill_between instead).
See also #24827 and #4897 (where I assume the first item refers to BrokenBarHCollection, as there's no BarHCollection).

I milestoned as 3.7 due to the deprecation, but can just rewrite it as a 3.8 deprecation as well.

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@anntzer anntzer added this to the v3.7.0 milestone Jan 1, 2023

Shade regions where a logical mask is True with `.Axes.fill_between` or with
`matplotlib.collections.BrokenBarHCollection.span_where`.
the deprecated `matplotlib.collections.BrokenBarHCollection.span_where`.
Copy link
Member

Choose a reason for hiding this comment

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

I'm moderately pro-deprecating in order to reduce the number of ways to do things, but then I think you should go all in and only show the recommend (new way) to do this in the example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The point is to document the transition path; the old way will be removed once the deprecation elapses.

Copy link
Member

Choose a reason for hiding this comment

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

I get doing that in the API docs, but why would someone looking at the examples need to know about the deprecated way to do something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine, I removed it.

It doesn't warrant a separate class; also, directly doing the unit
conversion in broken_barh is actually easier (one doesn't need to go
through _convert_dx, instead we directly move to using xmin/xmax).
@oscargus oscargus merged commit cc40f2a into matplotlib:main Jan 6, 2023
@anntzer anntzer deleted the ubbhc branch January 6, 2023 13:23
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.

span_where fails with timeseries on the x-axis
3 participants