Skip to content

Matplotlib content on setting consistent colorbars #276

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

Closed
brian-rose opened this issue May 4, 2022 · 8 comments · Fixed by #310
Closed

Matplotlib content on setting consistent colorbars #276

brian-rose opened this issue May 4, 2022 · 8 comments · Fixed by #310
Assignees
Labels
content Content related issue good first issue Clearly described and easy to accomplish. Good for beginners to the project.

Comments

@brian-rose
Copy link
Member

Producing two (or more) contour or pcolor plots of different arrays but with the same colorscale (for fair comparison) is something that comes up very frequently but isn't always obvious how to do with matplotlib.

I think our tutorials should have a simple example for how to achieve this, probably in the first intro notebook.

We have examples of more advanced colorbar control, but I think there's a gap on this important day-to-day plotting need.

@brian-rose brian-rose added the content Content related issue label May 4, 2022
@jukent jukent added the good first issue Clearly described and easy to accomplish. Good for beginners to the project. label May 9, 2022
@r-ford r-ford added this to the hackathon milestone Jun 24, 2022
@hCraker hCraker self-assigned this Jun 27, 2022
@brian-rose
Copy link
Member Author

@hCraker has built a nice short Cookbook on this topic now visible at https://cookbooks.projectpythia.org/mpl-colorbar-cookbook

Question: does it make more sense to keep this content in a free-standing Cookbook, or integrate into our basic Matplotlib tutorials here in Foundations?

@clyne
Copy link
Contributor

clyne commented Jul 10, 2022

Great question. I think we still struggle with defining what is and what is not a cookbook. But given the focus of the colorbar cookbook on using matplotlib, and its generality to all users, I guess I'd say Foundations would be a better fit for it. Is it worth the effort to move it? Not sure. At the very least it would be good to link to it from the Foundations material.

@ktyle
Copy link
Contributor

ktyle commented Jul 10, 2022

I think it would be a valuable component of the Foundations' matplotlib content ...

@hCraker
Copy link
Contributor

hCraker commented Jul 11, 2022

Great question. I think we still struggle with defining what is and what is not a cookbook. But given the focus of the colorbar cookbook on using matplotlib, and its generality to all users, I guess I'd say Foundations would be a better fit for it. Is it worth the effort to move it? Not sure. At the very least it would be good to link to it from the Foundations material.

While we haven't settled on a complete definition, the majority of the cookbooks have multiple pages and are longer than the foundation notebooks. Cookbooks also cover more niche topics. I would say the topic of the cookbook I made is general enough and covered in a sufficiently small tutorial that it would belong in foundations rather than cookbooks. For consistency and user ease for finding information, it's worth moving this notebook.

@brian-rose
Copy link
Member Author

Agreed! I think it's a Foundational topic.

The alternative would be to plan to develop a longer series of "specialized" matplotlib lessons to house in the Cookbook, but there are many other places online to find such lessons.

It should be a relatively easy lift to move the Colorbars notebook and integrate it into Foundations.

@hCraker
Copy link
Contributor

hCraker commented Jul 11, 2022

It looks like the foundations page already talks about shared colorbars and choosing accessible colormaps. Do we even need my notebook? I didn't go into much more detail thank what's already shown on the foundations pages.

@dopplershift
Copy link
Contributor

Looking through that, it could certainly use some more explanation about the role of Normalize in controlling the range of the colormapping and keeping things common between multiple plots.

@hCraker
Copy link
Contributor

hCraker commented Jul 12, 2022

I'll open a PR to merge the existing shared colorbar content with what's in my cookbook. @dopplershift thanks for pointing out the need for more instruction on using Normalize. I'll include that as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Content related issue good first issue Clearly described and easy to accomplish. Good for beginners to the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants