This might be a simple question but I can’t find any documentation on this. I’m trying to run my python script and am saving my plots offline with py.plot(fig,filename='sampleplot.html)
This is all good and the plot saves, but whenever I run the script I get an error on my command line: xdg-open: no method available for opening 'C:/sampleplot.html'
Am I saving it in the wrong format? Don’t get why it’s trying to open the plot, I just want it to be saved. Is there a savefig function similar to matplotlib? Thanks for the help
@ronenshohatpy.plot(fig, filename=name.html') sends the plot to Plotly cloud, and doesn’t save the file on your system.
If you are working offline, then plotly.offline.plot(fig, filename='name.html') saves the html file on your machine and you can open it in a browser, but usually it opens instantly.
yeah I’m using polty.offline.plot. It saves the html file to my machine, but whenever I run the script I think it’s trying to open the file in my command terminal and I get an xdg-open error. Is there any way to stop this from being outputted?
But I just want to save the HTML file, not open up the chart once it’s run- does that make sense? Is there no way to do this? I thought there was an entire thing of functionality built into plotly offline
As of version 4.0, the write_html() function is available on go.Figure objects as well, so you can do fig.write_html("path/to/file.html") directly now too.