Skip to content

Cannot convert matplotlib heat map to pyplot #5048

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

Closed
jacobromero opened this issue Feb 20, 2025 · 1 comment
Closed

Cannot convert matplotlib heat map to pyplot #5048

jacobromero opened this issue Feb 20, 2025 · 1 comment

Comments

@jacobromero
Copy link

While trying to convert a Matplotlib Heatmap figure to a plotly object I am getting the following message, as well as a blank graph.

UserWarning:

Aw. Snap! You're gonna have to hold off on the selfies for now. Plotly can't import images from matplotlib yet!

UserWarning:

Dang! That path collection is out of this world. I totally don't know what to do with it yet! Plotly can only import path collections linked to 'data' coordinates

Image

This is also happens when trying with seaborn heatmaps as well.


code to reproduce

import plotly.tools as tools
import numpy as np
import matplotlib.pyplot as plt

data = np.random.rand(10, 10)  # 10x10 random matrix

fig1: plt.Figure = plt.figure()
ax1 = plt.imshow(data, cmap='viridis', aspect='equal')
plt.colorbar(ax1)
plt.title('Matplotlib Heatmap')

tools.mpl_to_plotly(fig1)
@gvwilson
Copy link
Contributor

Hi - we are trying to keep the issues and PRs in Plotly's public repositories tidy so that we can focus on things that are most important to our community. For tech support and "how-to" questions, please post in our community forum https://community.plotly.com/. Thank you - @gvwilson

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

2 participants