-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Doc: Sort named colors example by palette #12209
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
Doc: Sort named colors example by palette #12209
Conversation
7085b1d
to
a176552
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description should be updated. This is not a " Simple plot example" anymore.
=======================
Listing of named colors
=======================
This is a list of the named colors supported in matplotlib. Note that
xkcd colors are supported as well, but are not listed here for brevity.
For more information on colors in matplotlib see
Maybe link [xkcd colors].
Bonus points, if you give the titles a bit more vertical space. They are quite squeezed to the colors (c.f. the example in my comment).
examples/color/named_colors.py
Outdated
return fig | ||
|
||
plot_colortable(mcolors.BASE_COLORS, "Base Colors", | ||
sort_colors=False, emptycols=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use emptycols=1
. That way the columns will be bgr, cmy and kw, which is sort of a natural grouping.
a176552
to
334d4de
Compare
All good comments. Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also change the title to "Listing of named colors" or "Overview of named colors". That's more to the purpose of the page. "Visualizing" puts too much emphasis on the drawing aspect. The example is basically there to look at the result, not to be able to do this yourself.
Sorry, I totally missed the point about the title. "Visualizing named colors" isn't exactly wrong. I find it actually better than "listing named colors" (which is how I must have read the title). Let me just add that not changing the title of examples between different versions has some advantage as well, as it allows to quickly find the same content for different versions of the docs. |
…209-on-v3.0.0-doc Backport PR #12209 on branch v3.0.0-doc (Doc: Sort named colors example by palette)
…209-on-v3.0.x Backport PR #12209 on branch v3.0.x (Doc: Sort named colors example by palette)
PR Summary
Two recent ideas (#11927 and #12009) of adding more named colors to matplotlib were decided not be pursued further. In the course of this, however, it was proposed by @timhoffm to sort the named colors example, which is kind of the lookup table for colornames, by category names.
Despite the fact that we now still have only 4 different categories, such segregated visualization still makes sense.
This PR changes the example to produce 3 individual figures (XKCD colors are left out, as that would produce a huge figure), one for the BASE_COLORS, the Tableau colors and the CSS colors, respectively.
Previously:
the named colors example
With this PR:
ci-built example (updated with feedback from below)
PR Checklist