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

Skip to content

DOC: Fix the bars having numeric value of cm but labeled as inches #25518

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
Mar 23, 2023

Conversation

ksunden
Copy link
Member

@ksunden ksunden commented Mar 20, 2023

This is admittedly more of a band-aid than a proper fix, but at least
make the generated figure correct.

The underlying problem is the more fundemental one of inconsistent units
behavior in which some artists can be re-united after plotting (e.g.
Line2D), while many others (e.g. Collections) cannot.

Thus, until that is addressed (which is one of the goals of the
data-prototype work), simply setting units early is as good as we can
do.

Closes #5051

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

This is admittedly more of a band-aid than a proper fix, but at least
make the generated figure correct.

The underlying problem is the more fundemental one of inconsistent units
behavior in which some artists can be re-united after plotting (e.g.
Line2D), while many others (e.g. Collections) cannot.

Thus, until that is addressed (which is one of the goals of the
data-prototype work), simply setting units early is as good as we can
do.

Closes matplotlib#5051
@ksunden ksunden added this to the v3.7-doc milestone Mar 20, 2023
@ksunden
Copy link
Member Author

ksunden commented Mar 20, 2023

Current version (the dataset changed from 3.6 to 3.7 here, but the units misbehavior was retained): https://matplotlib.org/3.7.0/gallery/units/bar_unit_demo.html

Note that the values are set in cm, but the units are supposed to be "inches", but the plotted values are the same as the cm values.

@jklymak
Copy link
Member

jklymak commented Mar 21, 2023

I'm 95% sure unit re-setting is possible only for Line2D, and was never implemented for anything else.

@timhoffm timhoffm merged commit c948e90 into matplotlib:main Mar 23, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 23, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 23, 2023
oscargus added a commit that referenced this pull request Mar 23, 2023
…518-on-v3.7.1-doc

Backport PR #25518 on branch v3.7.1-doc (DOC: Fix the bars having numeric value of cm but labeled as inches)
oscargus added a commit that referenced this pull request Mar 23, 2023
…518-on-v3.7.x

Backport PR #25518 on branch v3.7.x (DOC: Fix the bars having numeric value of cm but labeled as inches)
@hamogu
Copy link
Contributor

hamogu commented Mar 23, 2023

closed a 4-digit issue. Yeah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Units example broken
4 participants