FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Colormaps should have a `_repr_html_` that is an image of the colormap · Issue #15616 · matplotlib/matplotlib · GitHub

Repository navigation

Colormaps should have a _repr_html_ that is an image of the colormap #15616

Closed

Description

colorcet has a swatch function in the plotting module that creates an image of the colormap.

I think that the colormaps should have a _repr_html_ that does something similar.

Activity

  1. jklymak commented on Nov 7, 2019

    Member

    Would be cool. How does it get used?

  2. story645 commented on Nov 7, 2019

    Member

    In jupyter notebook you could type cm.jet and it'd print out a swatch

  3. jsignell commented on Nov 7, 2019

    Author

    Whoops I guess I should have mentioned that part :)

  4. timhoffm commented on Nov 7, 2019

    Member

    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.

  5. jsignell commented on Nov 7, 2019

    Author

    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 :)

  6. dopplershift commented on Nov 7, 2019

    Contributor

    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.

  7. added
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Jul 7, 2020
  8. bdice commented on Jul 11, 2020

    Contributor

    I would like to work on this for the SciPy 2020 sprint. 😃

  9. Carreau commented on Jul 11, 2020

    Contributor

    you likely want a _repr_png_, so that non-html frontend can display it.

  10. added this to the v3.4.0 milestone on Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    New feature🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL