Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Visually more uniform colortable#27924

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
timhoffm wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromtimhoffm:colortable-sort

Conversation

timhoffm
Copy link
Member

High variations in saturation make the colortable somewhat non-uniform. By splitting into low/high saturation groups, the table IMHO looks better.

image

High variations in saturation make the colortable somewhat non-uniform.By splitting into low/high saturation groups, the table IMHO looksbetter.
@github-actionsgithub-actionsbot added the Documentation: examplesfiles in galleries/examples labelMar 14, 2024
@timhoffmtimhoffm marked this pull request as draftMarch 14, 2024 10:47
@story645
Copy link
Member

I think it's a depends what you're trying to do situation?

Like I really don't like splitting the grays and I'm partial to sorting on hues cause I'm usually looking at that table to find/build a gradient?

@jklymak
Copy link
Member

Agree with@story645 - by-hue makes more sense to me than by-saturation. Usually you are looking for a shade of green, not any color with a certain saturation.

As an aside, it would nice if this gallery were linked athttps://matplotlib.org/stable/users/explain/colors/colors.html, and/or merged. I also think it would be nice if we added the full xkcd colortable - sure 954 colors is a lot, but its not that many

@jklymak
Copy link
Member

.. should add, I don't see why we couldn't include both sortings, if both seem useful.

tacaswell reacted with thumbs up emoji

@tacaswell
Copy link
Member

If we are doing multiple sortings we should also include the alphabetical one as well.

@story645
Copy link
Member

If we are doing multiple sortings we should also include the alphabetical one as well.

We don't really use sphinx design in the gallery but maybe makes sense to put in a tab grouping - hue, saturation, alphabetical-which I wonder if it'd be good to move this table into the color reference kinda like@jklymak suggested

@timhoffm
Copy link
MemberAuthor

timhoffm commentedMar 15, 2024
edited
Loading

TL;DR: Let's table this for later.

Still, I want to comment on your remarks.

by-hue makes more sense to me than by-saturation. Usually you are looking for a shade of green, not any color with a certain saturation.

I believe a fundamental partition by-saturation makes sense. Low saturation is more suited for large areas (facecolor), high saturation is more suited for small objects (text, marker, ...). Note that for examplehttp://davidbau.com/archives/2013/09/28/css_color_names.html also aggregates low-saturation colors together.

Like I really don't like splitting the grays

Thathas always been there, but I agree it should be improved.

I'm partial to sorting on hues cause I'm usually looking at that table to find/build a gradient?

I would say, that the old one is not at all better for this:

old:image new:image

The strong variation on saturation makes the gradient uneven.

@story645
Copy link
Member

The strong variation on saturation makes the gradient uneven

This is making me think that maybe the sort should be (hue, saturation) table, sorta like Google docs:Screenshot_20240316-204629.png

@timhoffm
Copy link
MemberAuthor

You could try, but google has the advantage that they can choose the colors, and thus choose a grid in (hue, saturation) space.

The CSS4 colors are unevenly spaced, so that it may be quite hard pressing them in a (hue, saturation) grid:

import matplotlib.pyplot as pltimport matplotlib.colors as mcolorshsv = np.array([mcolors.rgb_to_hsv(mcolors.to_rgb(c)) for c in mcolors.CSS4_COLORS])plt.scatter(hsv[:,0], hsv[:,1], c=mcolors.CSS4_COLORS)plt.xlabel("hue")plt.ylabel("sat")

image

story645 reacted with eyes emoji

@timhoffm
Copy link
MemberAuthor

Note: Prior to this PR all colors are sorted by hue only, i.e. in the above picture, strictly go from left to right. This results in quite stong saturation variations. This PR separtes the 2D hue/sat space in two groups, splitting at sat=0.2, and for each group draw by hue, i.e. go from left to right.

image

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Documentation: examplesfiles in galleries/examples
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@timhoffm@story645@jklymak@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp