owise
owise

Reputation: 1075

Saving plotly plots in one pdf file

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?

Upvotes: 4

Views: 12559

Answers (2)

lcorag
lcorag

Reputation: 562

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:

Upvotes: 8

It_is_Chris
It_is_Chris

Reputation: 14113

I believe you do need to pay in order to save as a pdf:

py.plotly.image.save_as(fig, filename='file.pdf')

PlotlyRequestError: Hi there! Accounts on the Community Plan can only download PNG and JPEG (raster) images.

To download publication-quality vector images (SVG, PDF, and EPS), please upgrade your account.

UPGRADE HERE: https://plot.ly/products/cloud

you can save them as a jpeg or png:

py.plotly.image.save_as(fig, filename='file.png')

Upvotes: 0

Related Questions