Skip to content

feature request: imshow() like matplotlib or cv2 #1702

Description

@YoniChechik

i'm familiar with go.layout.Image(), but it missing for me crucial "show closes data on hover" pixel RGB value + it can't show image from np.array.

I guess that the closest thing to start from when implementing this is heatmaps with the ability to control each pixel RGB value

it can really bring plotly to a lot more computer vision oriented programing (mainly in jupyter) and make plotly even better.

Activity

  1. jonmmease commented on Aug 6, 2019

    @jonmmease
    Contributor

    Hi @YoniChechik,

    Yeah, this would be really nice. There's an open issue with the plotly.js project to add a native trace for doing this (plotly/plotly.js#3898).

    One approach that I've thought of trying, but haven't yet, is overlaying a transparent heatmap on top of a layout.image. Heatmaps have an opacity property that can be set to 0 while still preserving tooltips. If this was a helpful approach, we could automate it as a figure factory or plotly express utility until plotly.js adds native support.

    One downside, though, is that the pixels of a layout.image object are smoothed. So you don't get the crisp heatmap-style pixel boundaries when you zoom in. But this might be something that could be addressed as a new option in plotly.js for layout.image objects.

    Are you interested in investigating this approach?

  2. YoniChechik commented on Aug 6, 2019

    @YoniChechik
    Author

    @jonmmease I'd be happy to help, but I no nothing about node js... The one input I can give is that the use of layout.image is wrong since the need of per-pixel separation is key! I think that changing the heatmap input to accept 3D arrays and choose each pixel color accordingly is the way to go

  3. jonmmease commented on Aug 17, 2019

    @jonmmease
    Contributor

    The one input I can give is that the use of layout.image is wrong since the need of per-pixel separation is key!

    Yeah, I agree. So we'll need to wait for something to be added in the plotly.js layer.

  4. YoniChechik commented on Oct 24, 2019

    @YoniChechik
    Author
  5. nicolaskruchten commented on Oct 24, 2019

    @nicolaskruchten
    Contributor

    Yep @YoniChechik we've designed image in plotly.js specifically to support this feature, which should come out in Plotly.py v4.3 :)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions