Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.2k
DOC: update colors from colormaps example#27708
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