You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Colormaps should have a _repr_html_ that is an image of the colormap #15616
That's a fancy feature and if somebody wants to implement that, go for it.
However, I suspect that it's more fancy than actually useful. The only purpose I see for drawing a standalone colormap is getting an impression of the colors. I would primarily do that for selecting a suitable colormap. But in such a scenario I would not necessarily know the name, and I would like to compare different maps. Both can be addressed better by the colormap reference.
Well I definitely tend to think about such things from the perspective of a higher level package that would consume the _repr_html_ (such as panel). If you think about it from that perspective you can imaging someone easily displaying a bunch or colormaps by having them render themselves using their _repr_html_. Definitely fancy though :)
It’s always nice for users to be able to do things without referring to an external resource, and in this case not have to refer to our colormap reference example. Otherwise, the jupyterlab/notebook environment wouldn’t have that handy “shift-tab bring up a tooltip” functionality.
I also think it’s nice for users who are offline and don’t have quick access to the colormap reference.
Activity
jklymak commentedon Nov 7, 2019
Would be cool. How does it get used?
story645 commentedon Nov 7, 2019
In jupyter notebook you could type
cm.jetand it'd print out a swatchjsignell commentedon Nov 7, 2019
Whoops I guess I should have mentioned that part :)
timhoffm commentedon Nov 7, 2019
That's a fancy feature and if somebody wants to implement that, go for it.
However, I suspect that it's more fancy than actually useful. The only purpose I see for drawing a standalone colormap is getting an impression of the colors. I would primarily do that for selecting a suitable colormap. But in such a scenario I would not necessarily know the name, and I would like to compare different maps. Both can be addressed better by the colormap reference.
But maybe I'm overlooking a real-world use-case.
jsignell commentedon Nov 7, 2019
Well I definitely tend to think about such things from the perspective of a higher level package that would consume the
_repr_html_(such as panel). If you think about it from that perspective you can imaging someone easily displaying a bunch or colormaps by having them render themselves using their_repr_html_. Definitely fancy though :)dopplershift commentedon Nov 7, 2019
It’s always nice for users to be able to do things without referring to an external resource, and in this case not have to refer to our colormap reference example. Otherwise, the jupyterlab/notebook environment wouldn’t have that handy “shift-tab bring up a tooltip” functionality.
I also think it’s nice for users who are offline and don’t have quick access to the colormap reference.
bdice commentedon Jul 11, 2020
I would like to work on this for the SciPy 2020 sprint. 😃
Carreau commentedon Jul 11, 2020
you likely want a
_repr_png_, so that non-html frontend can display it.