Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving plotly plots in one pdf file

Tags:

pandas

plotly

I am trying to save plotly plots generated within a for a loop into one pdf fil, but here is says we need to pay for it

Is there any updates on this feature? Do we really need to pay to save as pdf?

like image 398
owise Avatar asked Sep 15 '25 12:09

owise


1 Answers

For anyone else still looking for a quick answer 2 years later:

It is possible to export static plotly figures as pdf. Produce a plotly figure, say fig. This has the .write_image method to export to several formats. Simply do:

fig.write_image("your_image.pdf")

NOTE: you may need to install kaleido (plotly uses it to convert to static images).

pip install -U kaleido

Then:

fig.write_image("your_image.pdf", engine="kaleido")

Credits and references:

like image 191
lcorag Avatar answered Sep 18 '25 10:09

lcorag



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!