-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: update colors from colormaps example #27708
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
Conversation
|
||
|
||
from cycler import cycler | ||
|
||
cmap = mpl.colormaps.get_cmap('Dark2') | ||
colors = cmap(range(cmap.N)) # cmap.N is number of unique colors in the colormap | ||
colors = mpl.colormaps['Dark2'].colors |
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.
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.
maybe turn that into a section heading to make it more obvious?
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.
Sectioning: The above should be something "Extracting values from a continuous colormap" (though technically most of the visually continous colormaps are still densely sampled ListedColormaps) and here "Extracting values from a discrete colormap".
I also suggest to not combine both the ListedColormap.colors
explanation and the the rc_context
into one plot. That's confusing. Either drop the rc_context
, or make it a separate plot.
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.
Small comments since this hasn't been merged yet.
|
||
For more details about manipulating colormaps, see :ref:`colormap-manipulation`. | ||
Once we have hold of a `.Colormap` instance, individual colors can be accessed by | ||
passing one or more floats or integers. For more details about manipulating colormaps, |
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.
passing one or more floats or integers. For more details about manipulating colormaps, | |
passing one or more floats or integers. For more details about manipulating colormaps, |
Sorry for the late review, but passing to what?
|
||
|
||
from cycler import cycler | ||
|
||
cmap = mpl.colormaps.get_cmap('Dark2') | ||
colors = cmap(range(cmap.N)) # cmap.N is number of unique colors in the colormap | ||
colors = mpl.colormaps['Dark2'].colors |
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.
maybe turn that into a section heading to make it more obvious?
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.
Sorry for leaving this hanging - too much to do.
|
||
|
||
from cycler import cycler | ||
|
||
cmap = mpl.colormaps.get_cmap('Dark2') | ||
colors = cmap(range(cmap.N)) # cmap.N is number of unique colors in the colormap | ||
colors = mpl.colormaps['Dark2'].colors |
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.
Sectioning: The above should be something "Extracting values from a continuous colormap" (though technically most of the visually continous colormaps are still densely sampled ListedColormaps) and here "Extracting values from a discrete colormap".
I also suggest to not combine both the ListedColormap.colors
explanation and the the rc_context
into one plot. That's confusing. Either drop the rc_context
, or make it a separate plot.
7901255
to
d8e2594
Compare
d8e2594
to
cca84fc
Compare
Thanks @story645, @timhoffm. How's this? |
Thanks, this looks good! I would also say that @story645's comment is addressed, but let's give her the final word. |
Awesome, thanks @rcomer ! |
…708-on-v3.8.2-doc Backport PR #27708 on branch v3.8.2-doc (DOC: update colors from colormaps example)
…708-on-v3.8.x Backport PR #27708 on branch v3.8.x (DOC: update colors from colormaps example)
PR summary
Follow up to #27678 based on comments there from @timhoffm.
PR checklist