-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Add missing cmaps to perception doc (fix for #8073) #8156
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: Add missing cmaps to perception doc (fix for #8073) #8156
Conversation
I am not sure that I read the |
'pink', 'spring', 'summer', 'winter']), | ||
('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper', | ||
'gist_heat', 'gray', 'hot', 'pink', 'spring', | ||
'Wistia', 'summer', 'winter']), |
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.
Taking a step back, I think we have three subgroups of sequential colormaps:
- single color
- blended colors
- temperature/seasons
I guess I'd really like to see plots for each of these groups.
Opinion: And within each group, we should sort/group as logically as possible, as opposed to alphabetically
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.
See 3c29961: I tried to group the colormap in a more logical or hue-base fashion, rather than per alphabetical order.
|
||
mpl.rcParams.update({'font.size': 12}) | ||
|
||
# indices to step through colormap | ||
# Number of colormap par subplot for particular cmap categories | ||
_DSUBS = {'Perceptually Uniform Sequential': 4, 'Sequential': 6, |
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.
It'd be nice if we could compute the values in someway. I that would require the colors module to be reorganzed in some way. And that's definitely out of the scope of this PR.
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 new order (and the addition of some previously missing colormaps) in 3c29961 allow a more uniform set of values for _DSUBS
and _DC
. Basically only two different values are sufficient to clean reference plots.
I have kept an explicit dictionary with all values inside, in case one would want to further tweak these values. One could also use these dictionary to just describe the non-standard cases and rely on .get(key, default)
for the others.
|
||
mpl.rcParams.update({'font.size': 12}) | ||
|
||
# indices to step through colormap | ||
# Number of colormap par subplot for particular cmap categories |
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.
"par" -> "per" ?
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.
Yep (French went through the cracks of my mind…).
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.
Fixed!
@phobson Thank you for the feedback :). I will try to see what is feasible this weekend. |
@afvincent don't hesitate to ping us when it is done. This PR disappeared from the frontpage. |
@NelleV Ok and don't worry, it is still in my to-do list. I was just (and am still) trying to finish the other stuff I am working on in parallel, like the eventplot stuff (with your comments waiting to be addressed for example ;) ). |
Removing the Note to self: I think Wistia is missing from the colormaps that I demonstrated in the gallery example. |
dd553cf
to
3c29961
Compare
Rebased and added some missing colormaps ( I do not really understand why, but I modified Building the docs results in: |
the doc/examples folder is generated from the examples. The fact that it is not tracked is to be expected. |
Once the sphinx-gallery PR is merged, those python script should really be moved to our examples folder. |
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.
LGTM
'Sequential (2)': 6, 'Diverging': 6, 'Qualitative': 4, | ||
'Miscellaneous': 6} | ||
|
||
# Spacing between the colormaps of a subplot |
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 think it makes more sense to change the figure size like it used to be done. Now you get a different sized Axes and different number of ticks for each figure.
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 do not understand to which situation you are refering to: looking at blame on GH, the dc
and dsub
strategy is used since at least 3 years. I tried to not modify the spirit of the plots, but rather to refactor what could be, and to make the magic values a bit more uniform across all the different cases.
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.
Oh, this comment probably shouldn't be here but on a subplots
line. In any case, I missed the fact that you kept the changing figure size, so it should be the same as before.
But if the figure size changes based on the number of plots, then I don't understand why 00 and 05 have 3 y-ticks, but the others have 5.
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 did not even notice the different amount of ticks ^^... If I had to guess, I would say that it may be an artifact from plt.tight_layout()
that gives more or less place to the subplots depending on length of the x-tick labels.
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.
That might be it. It would be nice if we didn't have to use tight_layout
, but I guess then we'd need to know the size of the colormap labels first.
Please do not merge yet, I saw a minor typo (l.37 on Edit: the typo has been fixed. I the unconsistent number of y-ticks that @QuLogic noticed is an issue, what about to simply use an ad-hoc formatter? Maybe even something as simple as |
…on_doc DOC: Add missing cmaps to perception doc (fix for #8073)
Backported to |
Fixes #8073 .
Add the missing
tab10
andtab20*
colormaps to the relevant web page, that are currently missing as noticed by #8073 . I also added theWistia
colormap that also appears to be missing from this documentation.I did a minor clean up of the
grayscale.py
script (removing some outdated comments for example). Furthermore, the last commit is an overhaul of thelightness.py
script, aiming at making it a bit more resilient to adding or deleting one colormap map without having to tweak a lot of "magical" constant values determined by hand. I manly tried to factorize some parts when it seemed possible to do some.The documentation is still building well :). Here is a self-contained archive version of the




colormaps.html
web page, with the updated plots: Choosing_Colormaps_doc.zip. For example, the figures with the Vega-related and Wistia colormaps:If this was to be merged, please backport it to
2.0.0-doc
(See @tacaswell's comment in #8073). I am still not totally friend with git and did not manage to directly target the2.0.0-doc
branch 🐑 ...Edit: added a keyword to automatically close the related issue.