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

Plotly plots not showing properly on the dashboard #2191

Closed
mariatirindelli opened this issue May 12, 2021 · 3 comments
Closed

Plotly plots not showing properly on the dashboard #2191

mariatirindelli opened this issue May 12, 2021 · 3 comments
Labels
a:app Area: Frontend/Backend

Comments

@mariatirindelli
Copy link

I am trying to plot a stack of images as an animation frame (example "Exploring 3-D images and timeseries with animation_frame" in https://plotly.com/python/imshow/). I can correctly plot with plotly, but when I log on wandb I see an empty space, with the sliding bar.

The code I'm running is:

import wandb
wandb.init(project="plot tests")

import plotly.express as px
from skimage import io
data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif")
img = data[25:40]
fig = px.imshow(img, animation_frame=0, binary_string=True, labels=dict(animation_frame="slice"))

wandb.log({"my_chart": fig})

And here's what I get in wandb
Acquisisci2

I run the code on my Windows machine:

  • OS: Windows 10
  • Browser: tested on both Chrome and Safari
  • Version [e.g. 22] wandb version: '0.10.30', plotly version: 4.14.3
@mariatirindelli mariatirindelli added the a:app Area: Frontend/Backend label May 12, 2021
@ariG23498
Copy link
Contributor

Hey @mariatirindelli
Thanks for the ticket. We will be tracking this internally.

Note: In a colab notebook we probably need to upgrade plotly to the latest release to avail the animation_frame parameter.

@cvphelps
Copy link
Contributor

Thanks for reporting this! The issue is that Plotly is not maintaining their converter to JSON well. We can't fix this on our side since it's a plotly bug, but if you log the plot as an image we will render that faithfully.

@lucmos
Copy link

lucmos commented Apr 21, 2022

It is possible to do the following as a workaround:

wandb.log({"my_chart": wandb.Html(plotly.io.to_html(fig)})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:app Area: Frontend/Backend
Projects
None yet
Development

No branches or pull requests

4 participants