Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
DOC: Add missing cmaps to perception doc (fix for #8073) #8156
Conversation
afvincent
added Documentation needs_review
labels
Feb 26, 2017
afvincent
added this to the
2.0.1 (next bug fix release)
milestone
Feb 26, 2017
|
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']), |
phobson
Mar 1, 2017
Member
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
afvincent
Mar 25, 2017
Contributor
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 |
| 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, |
phobson
Mar 1, 2017
Member
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.
afvincent
Mar 25, 2017
Contributor
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.
|
@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. |
afvincent
removed the
needs_review
label
Mar 12, 2017
afvincent
changed the title from
DOC: Add missing cmaps to perception doc (fix for #8073) to [WiP] DOC: Add missing cmaps to perception doc (fix for #8073)
Mar 12, 2017
afvincent
added some commits
Feb 20, 2017
|
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. |
NelleV
changed the title from
[WiP] DOC: Add missing cmaps to perception doc (fix for #8073) to [MRG+1] DOC: Add missing cmaps to perception doc (fix for #8073)
Mar 25, 2017
| + 'Sequential (2)': 6, 'Diverging': 6, 'Qualitative': 4, | ||
| + 'Miscellaneous': 6} | ||
| + | ||
| +# Spacing between the colormaps of a subplot |
QuLogic
Mar 25, 2017
•
Member
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.
afvincent
Mar 26, 2017
Contributor
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.
QuLogic
Mar 26, 2017
Member
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.
afvincent
Mar 26, 2017
Contributor
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.
QuLogic
Mar 26, 2017
Member
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 |
dstansby
merged commit 50bb88a
into matplotlib:master
Apr 2, 2017
5 checks passed
dstansby
changed the title from
[MRG+1] DOC: Add missing cmaps to perception doc (fix for #8073) to DOC: Add missing cmaps to perception doc (fix for #8073)
Apr 2, 2017
dstansby
added a commit
that referenced
this pull request
Apr 2, 2017
|
|
dstansby |
8be411f
|
|
Backported to |
afvincent commentedFeb 26, 2017
•
edited
Fixes #8073 .
Add the missing
tab10andtab20*colormaps to the relevant web page, that are currently missing as noticed by #8073 . I also added theWistiacolormap that also appears to be missing from this documentation.I did a minor clean up of the
grayscale.pyscript (removing some outdated comments for example). Furthermore, the last commit is an overhaul of thelightness.pyscript, 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.htmlweb 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-docbranchEdit: added a keyword to automatically close the related issue.