Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| 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 theListedColormap.colors explanation and the therc_context into one plot. That's confusing. Either drop therc_context, or make it a separate plot.
rcomer commentedJan 26, 2024
story645 left a comment
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.
| passingoneormorefloatsorintegers.Formoredetailsaboutmanipulatingcolormaps, | |
| passingoneormorefloatsorintegers.Formoredetailsaboutmanipulatingcolormaps, |
Sorry for the late review, but passing to what?
| 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?
timhoffm left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Uh oh!
There was an error while loading.Please reload this page.
| 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 theListedColormap.colors explanation and the therc_context into one plot. That's confusing. Either drop therc_context, or make it a separate plot.
rcomer commentedFeb 3, 2024
Thanks@story645,@timhoffm.How's this? |
timhoffm commentedFeb 3, 2024
Thanks, this looks good! I would also say that@story645's comment is addressed, but let's give her the final word. |
story645 commentedFeb 4, 2024
Awesome, thanks@rcomer ! |
…708-on-v3.8.2-docBackport PR#27708 on branch v3.8.2-doc (DOC: update colors from colormaps example)
…708-on-v3.8.xBackport 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