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

Skip to content

Rewrite bullseye example to use bar() instead of pcolormesh(). #24967

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 26, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 13, 2023

It is much simpler to take advantage of bar()'s support for polar plots. Also improve z-ordering of various elements so that edges don't get overdrawn (or clipped).

before
old
after
new
Note the subtle difference in the bold edges in the last plot.

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

@story645
Copy link
Member

Is there a reason then to keep this as a standalone and not merge w/ https://matplotlib.org/devdocs/gallery/pie_and_polar_charts/nested_pie.html ?

Or at least then link to this example from that one as an advanced example?

@jklymak
Copy link
Member

jklymak commented Jan 13, 2023

Whether or not this is a good change depends on the goal of the example? If it's just to create a bullseye plot then the change seems fine. If it's to show off the flexibility of pcolormesh, then maybe both methods are worth showing?

It is much simpler to take advantage of bar()'s support for polar plots.
Also improve z-ordering of various elements so that edges don't get
overdrawn (or clipped).
@anntzer
Copy link
Contributor Author

anntzer commented Jan 13, 2023

I would say this is a quite bad usage of pcolormesh: it needs to create the segments one at a time and even then needs to manually generate interpolated theta values to get the right shapes.
Linking with the nested pie example seems fine, done.

@jklymak jklymak merged commit 9771b71 into matplotlib:main Jan 26, 2023
@anntzer anntzer deleted the be branch January 26, 2023 17:19
@QuLogic QuLogic added this to the v3.8.0 milestone Jul 28, 2023
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.

4 participants