Skip to content

Add contour and tricontour plots to plot types #21114

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
Sep 19, 2021

Conversation

timhoffm
Copy link
Member

No description provided.

@jklymak
Copy link
Member

jklymak commented Sep 19, 2021

I think there is benefit to not cluttering this list up too much, versus an attempt to be comprehensive. I'm not sure separating contour and contourf is worth the extra entry(s)?

@story645
Copy link
Member

I like it seperate since I think a goal of this is making explicit implicit assumptions about data structure, in this case that it's unstructured coordinates. But kinda think this should go under the imshow/array section.

@jklymak
Copy link
Member

jklymak commented Sep 19, 2021

tricontour/f already had its own entry. The question here is whether we need separate entries for each of contour and contourf and tricontour and tricontourf.

@story645
Copy link
Member

story645 commented Sep 19, 2021

Reading through the docs, I'm very confused about when to use the regular version vs. the f one, & that's not explained when collapsed into one example either. (I never remember that f stands for filled). I think separating the two here makes that clear, which I think is a good idea.

Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

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

Should levels be set w/ rest of data?

@jklymak
Copy link
Member

jklymak commented Sep 19, 2021

Again, I don't think the goal here is to be comprehensive, but rather to give folks enough knowledge to know what to search for. In this case both ax.contour and ax.contourf link to the respective methods. The first sentence of either method is:
contour and contourf draw contour lines and filled contours, respectively.

@story645
Copy link
Member

story645 commented Sep 19, 2021

When I click through, the first sentence I see on both methods is

Draw contour lines on an unstructured triangular grid.

https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.tricontourf.html?highlight=tricontourf#matplotlib.pyplot.tricontourf

which I think is because of #17742?

And for me it's not about comprehensive, it's that contour and contourf have different use cases* and collapsing them like this makes that unclear.

Eta: what I mean by use cases isn't actually use cases, it's that the contour is visually encoding a line, contourf is visually encoding an area

@jklymak
Copy link
Member

jklymak commented Sep 19, 2021

Sure, if folks think they are distinct enough, they should get separate entries. I don't think they are, but that is just my opinion.

@timhoffm
Copy link
Member Author

I think they are distinct enough visually.

IMHO the main use case of "Plot types" is to look at the plots and decide which visual representation you want. And for that lines and filled areas are quite different. That they encode the same type of information is secondary. It's somewhat analogous to stem() encoding the same as bar() (or even plot() with marker only, but certainly you won't trade it easily for the others and would want to see that all of them exist.

@timhoffm
Copy link
Member Author

Note: I had to rename: examples/frontpage/contour.py → examples/frontpage/contour_frontpage.py

Apparently, Sphinx-gallery doesn't like the same name in different galleries:

WARNING: Duplicate example file name(s) found. Having duplicate file names will break some links. List of files: ['../plot_types/arrays/contour.py']

While the above renaming breaks someone external linking the front page coutour example, I anticipate that that'd be avery rare case and I willing to take that so that we have more consistent names in the plot_types.

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

Needs a rebate needs a rebase cause of #21123

@timhoffm timhoffm merged commit 03d25d9 into matplotlib:master Sep 19, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 19, 2021
@timhoffm timhoffm deleted the doc-contour-types branch September 19, 2021 21:02
timhoffm added a commit that referenced this pull request Sep 19, 2021
…114-on-v3.5.x

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

3 participants