Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
YoniChechik opened this issue Aug 4, 2019 · 5 comments
Closed

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

YoniChechik opened this issue Aug 4, 2019 · 5 comments

Comments

@YoniChechik
Copy link

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.

@jonmmease
Copy link
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?

@YoniChechik
Copy link
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

@jonmmease
Copy link
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.

@YoniChechik
Copy link
Author

@nicolaskruchten
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants