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

Updates to plot types #21221

Merged
merged 3 commits into from Sep 30, 2021
Merged

Updates to plot types #21221

merged 3 commits into from Sep 30, 2021

Conversation

timhoffm
Copy link
Member

PR Summary

  • Change plot_types categories:
    • barbs: stats -> arrays
    • pie: basic -> stats
  • Update plot_types barbs to show a more realistic use case:
    Barbs are a visualization of vector fields and usually plotted on a
    regular grid.
  • Simplify data generation for imshow and pcolormesh plot_types

@timhoffm timhoffm added this to the v3.5.0 milestone Sep 29, 2021
@story645
Copy link
Member

I have mixed feelings about pie charts since they're one of the most widely used almost everyone learns about them charts. Is turning counts into rations considered a computation?

@timhoffm
Copy link
Member Author

Is turning counts into rations considered a computation?

Sure. The distribution of fractions of a whole is genuinely a statistical topic.

The second and didactic motivation for the move is to deemphasize pie charts by placing them further down in a more specialized section. While it may be that "they're one of the most widely used almost everyone learns about them charts", typically there are better visualizations than pie charts https://www.google.com/search?q=don%27t+use+pie+charts. So let's show other plot types first. If we get someone to not choose a pie chart because they see something else first, I consider this a plus.

@jklymak
Copy link
Member

jklymak commented Sep 30, 2021

I agree with moving barbs.py. OTOH, its pretty specialized, and I kind of wonder if it should really be in here.

If we keep it, can it get the same flow field as quiver? They are really alternate ways to show the same thing.

@timhoffm
Copy link
Member Author

I kind of wonder if it should really be in here.

I'd tend to keep more types in here. We should show what we can. The preview pictures are small enough that some more plots don't significantly harm the overview. OTOH I don't have a strong opinion here.

If we keep it, can it get the same flow field as quiver? They are really alternate ways to show the same thing.

I find it hard to invent a dataset that illustrates both types of plots in the small previews well. Barbs have a more complex marker structure than arrows, so we need them to be bigger. While we could have equally few arrows, that'd be a less good vector field impression of quiver that is possible without that restriction on size and number of markers. Additionally, Barbs want a fixed scale of ~100 to show a variety of barb symbols. OTOH, such a dynamic range in arrow lengths is impractical as you'd only see the few largest arrows.

You are welcome to propse different data. I'm not attached to my choice. The data should just make sense for the individual visualizations.

One a side note: As discussed previously with quiver/streamplot, I don't see "using the same data" as a particular high priority between plot types. Sure if it's doable, but not at the cost of harming the visual impression of that plot type.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

I'm fine with the change, but lets make sure @story645 still is...

@story645 story645 merged commit 062b5b2 into matplotlib:master Sep 30, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 30, 2021
@timhoffm timhoffm deleted the plot-t branch September 30, 2021 14:12
@timhoffm
Copy link
Member Author

Thanks @jklymak, @story645 !

timhoffm added a commit that referenced this pull request Sep 30, 2021
…221-on-v3.5.x

Backport PR #21221 on branch v3.5.x (Updates to plot types)
tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request Oct 12, 2021
tacaswell pushed a commit that referenced this pull request Oct 20, 2021
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.

None yet

3 participants