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

Skip to content

DOC: Better doc of colors #22912

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 5 commits into from
Apr 28, 2022
Merged

DOC: Better doc of colors #22912

merged 5 commits into from
Apr 28, 2022

Conversation

larsoner
Copy link
Contributor

PR Summary

Improve https://matplotlib.org/3.5.0/gallery/color/named_colors.html by:

  1. Splitting colors into three sections so that they don't get put in a multiimg where each takes up half the horizontal space. This should make it much more readable.
  2. Add a .. contents so that each color category is easily accessible from the top.

You'll have to ignore my dark mode below since I took the 3.5 one from the actual URL but built my changes locally:

3.5 PR
contents N/A Screenshot from 2022-04-26 17-18-28
colors Screenshot from 2022-04-26 16-49-16 Screenshot from 2022-04-26 17-18-36

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@timhoffm
Copy link
Member

timhoffm commented Apr 26, 2022

Side-remark: It would be really cool if one could specify that individual code sections can be/are folded (or maybe completely omitted?) in sphinx-gallery. This is one of the gallery entries in which only the generated figure is relevant not the code that is generating it.

@larsoner
Copy link
Contributor Author

Agreed, I opened sphinx-gallery/sphinx-gallery#953 in case someone wants to discuss further and possibly implement!

@larsoner
Copy link
Contributor Author

@tacaswell tacaswell added this to the v3.6.0 milestone Apr 27, 2022
@timhoffm
Copy link
Member

The section titles and figure titles are redundant now. I think we can leave the figure titles out then.

@larsoner
Copy link
Contributor Author

The section titles and figure titles are redundant now. I think we can leave the figure titles out then.

The only time I can see it being useful is if someone wants to save the image, or link to it from somewhere else, then the title is gone for them. But I'll remove it since this seems rare enough not to worry about

@timhoffm timhoffm merged commit 9c590de into matplotlib:main Apr 28, 2022
@larsoner larsoner deleted the colors branch April 28, 2022 20:55
@timhoffm
Copy link
Member

timhoffm commented May 6, 2022

@larsoner is there a recommended way to suppress unneeded output from a block in sphinx-gallery?

image

I could imagine:

  • Add an explicit plt.show()
  • Terminate the last line with a colon
  • Is there a sphinx-gallery flag to suppress the output

@larsoner
Copy link
Contributor Author

larsoner commented May 6, 2022

You could always do an assignment:

_ = plot_colortable(...)

But for that specific example an easy fix is to not return the figure

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