Comments (2)
I'm not sure what glasbey_rw
is, but I can see why it's confusing for glasbey_hv
. I think it's actually already consistent, though the consistency may not be obvious:
- The native specification for every colormap (categorical or not) is as a list of numerical RGB values.
- E.g. for the "fire" colormap, the native values are in
colorcet.linear_kryw_0_100_c71
, and for "glasbey_hv", the native versions are incolorcet.glasbey_hv
. You can see these values incolorcet/__init__.py
.
- E.g. for the "fire" colormap, the native values are in
- There is also a Bokeh RGB version that we construct from the native one and make available for every colormap, with an attribute named as
b_
plus the name of the native version.- E.g. for the "fire" colormap, the Bokeh RGB values are in
colorcet.b_linear_kryw_0_100_c71
, and for "glasbey_hv" the Bokeh RGB values are incolorcet.b_glasbey_hv
- E.g. for the "fire" colormap, the Bokeh RGB values are in
What's confusing is that for some colormaps the usual way to refer to them is through an alias like cc.fire
, because the native names are long and unwieldy, and those aliases are to the RGB and not numeric triple version. There's no similarly long and unwieldy name for the glasbey maps, so it is tempting to use the native triple ones directly. Using them directly will work with systems that accept numeric triples, but Bokeh does not, so you need the b_
form.
Short of making Bokeh understand the list of numeric triples, I guess our options are to apologize and point out this issue in the docs, or change the name of the native Glasbey ones to something unwieldy and then use the names like glasbey_hv
for the RGB triples. Doing this will break at least some category of users, though, so we have to be sure it's worth doing.
from colorcet.
Sorry I meant glasbey_bw
, not glasbey_rw
, edited in my post.
Ok I understand the logic behind this, and it explains why on the contrary cc.glasbey_cool
for instance (or warm, dark etc) is a list of hex strings: it's the short name for cc.glasbey_bw_minc_20_hue_150_280
and is therefore not the native version.
In my opinion from a user perspective an inconsistency remains, as there is a different treatment for seemingly similar objects with short names (such as cc.glasbey_hv
and cc.glasbey_cool
). However it can be managed easily so maybe it's not worth considering breaking changes indeed. Udpating the docs may be more appropriate.
from colorcet.
Related Issues (20)
- "About Us" page refers to BSD license rather than Creative Commons HOT 2
- Over 300 test failures for `=dev-python/colorcet-2.0.6` HOT 3
- README not displayed on PyPI
- License in repository is CC-BY, but website says BSD HOT 7
- Support Python 3.12 HOT 3
- remove pyct / param dependency HOT 2
- Build breaks: ImportError: cannot import name '__version__' from 'param._version' HOT 1
- Add glasbey_tableau10? HOT 3
- Colorblind-safe categorical map? HOT 2
- swatch() needs docstring
- Update colorcet to upstream, especially new Gouldian Parula replacement HOT 1
- Possibility of change in License info on pypi from "Other/Proprietary License (CC-BY License)" to more explicit Creative Commons Intl ? HOT 9
- Allow more aliases HOT 1
- color palette name is not recognized HOT 3
- colorcet docs main webpage still refer to colorcet 1.0.0 HOT 1
- HoloViews warning when executing `swatches`
- matplotlib.cm.get_cmap returns a copy in 3.6.0 HOT 2
- Deprecation warning from matplotlib register_cmap HOT 1
- ValueError: A colormap named "cet_gray" is already registered HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorcet.