How to improve quality/resolution of plotly figure

Dear all,

Just wanted to summarize the solution regarding this.

Plots obtained by the client-side plotly library can be downloaded using the incorporated interactive buttons in the upper right corner of the plotly plot. However, when you download the plot in this way, the downloaded image in png format is of low quality. It is usable, but low quality for publications.

To download a better quality plot, the solution is to convert plotly plot to image using the “to_image” command. In this way, you can convert your plotly plot to the image in formats of jpg, jpeg, svg, etc.

If you are converting to jpg or png image, it is useful to use the scale option to improve the image’s resolution.

Here is the corresponding example for converting plotly plot to png image with six fold scale:

self.plot_1.to_image({‘format’:‘png’,‘scale’:6})

The example for converting plotly plot to svg would be:

self.plot_1.to_image({‘format’:‘svg’})

In the latter example, you can also use the scale option. You can use programs like Inkscape to work with vector graphics.

Many thanks to stefano.menci and james.patrick for their replies.

Also, it was extremely helpful to read this answer by stucork.

All the best,
Stevan

4 Likes