I generated a HTML graph using
plotly.offline.plot I want now to save an image, but the
Download plot as png quality really sucks and has no use for me. Of course, having a higher quality image would be nice but it will be even nicer for that button to let you choose the image format (format listed here).
Even more, pdf or svg would be nicer as I could zoom it without the loss of quality.
Does anyone have a solution for this?
If you are only creating an HTML file in order to save the figure you have created as an image, you might be able to avoid that step by generating an image directly from your figure in Python using the
orca utility as described by https://plotly.com/python/static-image-export/.
That could be a solution (and is what I am actually doing right now).
But I like that with HTML I can rotate image, change title (or delete it), etc. and then export the image… With this option I will have also the option to export one file (HTML) and generate other formats as I see fit without re running code.
For example, I like more svg but png is more easily supported by all platforms. I will have more flexibility if this button existed (and of course, more definition on the png image).
Thank you for clarifying your use case.
The functionality that you are describing would have to be added at the level of the
plotly.js library, which
plotly.py uses to produce figures.
Please feel free to log an issue at https://github.com/plotly/plotly.js/issues with your feature request!