Black Lives Matter. Please consider donating to Black Girls Code today.

Problem saving images from plotly?

Hi, I am using plotly in an ipython notebook (chrome on osx Mojave) and the plots appear fine on the notebook and look like this:


When I click on the “Download plot as a png” button or use fig.write_image or plotly.offline.iplot I get images that look like this:

I have tried Jupyter labs and safari to see if it was a notebook or browser issue but the images all come out broken.
Any help would be greatly appreciated!

Cheers,

Tom

Hi @tomcd, welcome to the forum and thank you for the bug report. Could you please share here a minimal standalone example (possibly using dummy data) so that we can reproduce the problem? Also, please tell us which version of plotly.py and jupyter you are using. Thanks!

Hi Emmanuelle,

I attached a csv of input data.

The example from the ipython notebook is:

########START###########

import plotly

fig = px.scatter_3d(df, y=‘xpos_dmm’, x=‘ypos’, z=‘H_Power’,color=‘H_Power’,
title = ‘MX3 DMM Heat Load Calculation’,
opacity=0.9,color_continuous_scale=px.colors.sequential.Rainbow)
fig.update_layout(margin=dict(l=0, r=0, b=0, t=0), scene = dict(
#title = dict(
# title=‘MX3 DMM Heat Load Calculation’),
xaxis = dict(
title=‘X position (mm)’),
yaxis = dict(
title=‘Y position (mm)’),
zaxis = dict(
title=‘Power (W/mm^2)’),),)

fig.show()

########END########

I am using Jupyter core 4.6.3, Notebook 5.7.4 and plotly 4.5.2.

Thanks for your help!

Tom

Hi Emmanuelle,

I attached the .csv of raw data.

Cheers,

Tom

(Attachment mask_heat_calculations_plotly.csv is missing)

Hi @tomcd I cannot see the uploaded data could you please upload the file on Github or Google docs for example?

Hi Emmanuelle,

I have uploaded it on google driver here:

https://drive.google.com/open?id=1zEPx6M22r0h4m_TwjDqfDkhqCc9bkN-e

Cheers,

Tom

Hi Tom, I executed your code but the resulting figure does not look like the one you posted above probably it was not created with px.scatter3d?


Also the image created from the “download as png” button looks the same (plotly 4.6 here, but your version of plotly is recent enough). Also tested with firefox, I will try with Chrome as well.

Hi Emmanuelle,

That image matches what I see on my machine.
I made a smaller set of data for testing (the original was 30mb) and on my mac inside the ipython notebook the image looks like this:

When I try to save as png it looks like this: