Skip to content

Embed plotly graphs

so I know that with plolty and chart studio we can save our plots online and then have an embedded link ready but there is a file limit and after publishing three small plots I get errors and can’t publish anything else.

Is there any chance I either convert Plotly graph as javascript (as it’s built with JS) and then save that somewhere to embed it later? I’m still very new to this and don’t understand everything from it.

My end goal is to embed my Plotly graphs in an article. Any help?

Answer

There are several options to export a ploty graph to be used elsewhere:

  • as a static image – once you have your fig you would use fig.write_image() and then embed that image in your article/website/etc. The details and options are detailed here.

or

  • as interactive html – once you have your fig you would use fig.write_html("path/to/file.html") and then embed that html in your site (I think an iframe would be used in this case). The details and options are detailed here.