I am new to Python and Dash and have been enjoying the experience so far. I come from using Matlab GUIDE, and really like the aesthetics in Dash. I am trying to save image to the disk from the ‘Save Image as png’ in the modebar.
Is there a way to save the image in a higher resolution than the display resolution? I would like to use vh to define the size of the plot. I would like to export it at a specified aspect ratio and resolution.
Is there a way to export as pdf as of now?
Is there a way to programmatically trigger export of the graphs as png?
It appears that Plotly.js has Plotly.toImage() to specify resolution and format. Can this be used in Python? (Sorry if this is a noob question)
These options are available through the plot.ly service (image and PDF generation is server side, not portable to the client libraries). There are two ways to access this:
Click the “Save and edit in cloud” button in the toolbar of a graph. This will open the graph in the Chart Studio interface. If you save the graph to your plotly account, then you can export it to PDF, EPS, and PNG at different resolutions and sizes. Note that that this requires a paid subscription if your data is private.
Use the Python API to programatically generate these images through the server. You’ll need a https://plot.ly account and an API key since this is generating the images and PDFs on the server: Static Image Export
This doesn’t do export to other formats besides PNG, PDF and EPS export require a variety of software packages to do reliably and is only available by Plotly through the API or the web service currently.
I’ve got formal question related to using Python API for programatically generating images through the server. As you pointed out, “You’ll need a Plot.ly account”. Mind that these are personal accounts.
So, how about using this export feature in a webapp used by several people?
Is it still aligned with https://plot.ly/terms-of-service/?
To give you a context, I’m going to prepare a dashboard with several simple graphs + “Download to PDF” button. Following the tutorial https://plot.ly/python/pdf-reports/ I need to convert charts to PNG files first.
Is there a way to be able to programmatically generate these images offline (either paid/free)?