Open andy-esch opened 6 years ago
Thanks for this suggestion! What are your thoughts on how folks would know that 'inferno' was a valid palette name in the first place? Docs?
Hi, any update on this? There should really be a simple rules_them_all dict-like structure available in palettable, so that the unique colormap name is necessary to access the colormap.
I think that a dictionary structure is desirable, as dot indexing is not convenient when one doesn't want to use a specific colormap of the package but rather make all of them accessible within a function, through the use of a string fed as a parameter.
Sometimes it can be hard knowing how to traverse
palettable
to get the palette you need. Unless I'm missing something, there does not seem to be a high level way of accessing palettes without prior knowledge about the structure of palettable. It'd be really handy to have a high-levelget
method to access a palette without advanced knowledge about how it's nested within palettable.For instance, some palettes can be accessed like:
E.g.,
palettable.colorbrewer.diverging.PRGn_11
. This requires more information than just the palette name. Programmatically, it'd be accessed like the following if a user needed a specific palette:Others palettes are accessed like:
For example,
palettable.matplotlib.Inferno_13
, which is much more easily accessible but still requires knowledge that the palette comes frommatplotlib
, which may or may not be relevant to the user.It'd be really nice to have a high-level
get
method (or something like that) to retrieve palettes by a unique name that would return the palette object that you want to retrieve information from.I can imagine something of the form:
The user is only defining what they want, but it adds the additional constraint that no two palettes across the package can have the same name.