# PlotlyJS interactive image of 3D plot

**URL:** https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117
**Category:** General Usage
**Tags:** plotlyjs
**Created:** [July 12, 2022, 6:16pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117 "2022-07-12T18:16:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Adam\_Davis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adam_davis/32/31470_2.png) [@Adam\_Davis](https://discourse.julialang.org/u/Adam_Davis)
#### Post date: [July 12, 2022, 6:16pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/1 "2022-07-12T18:16:58Z")

</div>

I have a 3D plot made using PlotlyJS.jl. This is done using Jupyter notebooks. When the plot is saved to a png it is only saved as a snapshot of the position of the plot at the time of saving.

What is the best way to save a plot made with PlotlyJS.jl in order to be able to have the plot be interactive on a webpage? I.e. a github ReadMe or a Medium article? Does PlotlyJS support this?

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [July 12, 2022, 10:01pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/2 "2022-07-12T22:01:46Z")

</div>

There are some options given here:  
[http://juliaplots.org/PlotlyJS.jl/stable/manipulating\_plots/#Saving-figures](http://juliaplots.org/PlotlyJS.jl/stable/manipulating_plots/#Saving-figures)

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [July 12, 2022, 10:15pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/3 "2022-07-12T22:15:19Z")

</div>

In particular, try `savefig(p, “myfig.html”) to get a “web page”.

---

<div class="post-metadata">

### Author: ![Adam\_Davis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adam_davis/32/31470_2.png) [@Adam\_Davis](https://discourse.julialang.org/u/Adam_Davis)
#### Post date: [July 12, 2022, 10:17pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/4 "2022-07-12T22:17:18Z")

</div>

Thank you. Have that existing file already. I am sort of stopped at uploading that anywhere.

---

<div class="post-metadata">

### Author: ![Adam\_Davis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adam_davis/32/31470_2.png) [@Adam\_Davis](https://discourse.julialang.org/u/Adam_Davis)
#### Post date: [July 12, 2022, 10:27pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/5 "2022-07-12T22:27:19Z")

</div>

My main intent is to preserve the interactiveness of this html file without creating a new website to display it if possible.

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [July 12, 2022, 11:58pm UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/6 "2022-07-12T23:58:33Z")

</div>

> [@Adam\_Davis](#):
>
> a github ReadMe

Since interactive PlotlyJS images are ultimately JavaScript, and GitHub doesn’t allow JavaScript in their Markdown README.md files when displaying, I guess the answer is no. (There is an old SO explanation here: [Embed JavaScript in GitHub README.md - Stack Overflow](https://stackoverflow.com/questions/21340803/embed-javascript-in-github-readme-md#21340902))

Some alternatives might be to use [GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site) as a linked web site; or, demonstrate the interactivity with an animated gif (see this thread: [Animation using PlotlyBase](https://discourse.julialang.org/t/animation-using-plotlybase/63292))

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [July 13, 2022, 12:05am UTC](https://discourse.julialang.org/t/plotlyjs-interactive-image-of-3d-plot/84117/7 "2022-07-13T00:05:23Z")

</div>

> [@Adam\_Davis](#):
>
> Medium article

I think that direct JavaScript embedding is also not allowed:

> **[Using embeds](https://help.medium.com/hc/en-us/articles/214981378#frequently-asked-questions-0-2)**
>
> Medium editor supports embedding content from third-party services, such as Twitter, Github gists, and more.
> 
> Desktop & iOS
> 
> 
> 
> While editing your story, go to a new line and paste the URL of th...

Maybe this?

> **[How to Embed Interactive Plotly Visualizations on Medium Blogs](https://jennifer-banks8585.medium.com/how-to-embed-interactive-plotly-visualizations-on-medium-blogs-710209f93bd)**
>
> I think graphs and other types of visualization products are amazingly effective in conveying your story with limited to no words. Making…
