# Getting PlotlyJS to show up for online jupyter notebooks

**URL:** <https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484>\
**Category:** Visualization\
**Created:** [May 2, 2017, 8:47pm UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484 "2017-05-02T20:47:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirestrepo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mirestrepo/32/617_2.png) [@mirestrepo](https://discourse.julialang.org/u/mirestrepo)\
**Post date:** [May 2, 2017, 8:47pm UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484/1 "2017-05-02T20:47:08Z")

</div>

Does anyone know a way to get the plots generated by PlotlyJS inside notebooks to show up online? (they render fine running in local host). In Github or nbviewer they are always blank for me

e.g  
[http://nbviewer.jupyter.org/github/bcbi/julia\_tutorials/blob/master/nnmf/nnmf\_classic3\_clustering.ipynb](http://nbviewer.jupyter.org/github/bcbi/julia_tutorials/blob/master/nnmf/nnmf_classic3_clustering.ipynb)

I looked at the examples at [https://github.com/JuliaPlots/ExamplePlots.jl](https://github.com/JuliaPlots/ExamplePlots.jl) and I don’t see any working case where plotlyjs is the backend. Did I miss one?

I also tried using nbconvert to html and same - I can see some errors in the developer console of Chrome.

Is this a know limitation?

We keep a collection of notebooks as examples for students, and I often use plotlyjs… but not being able to show the result/plots online defeats the purpose of the notebooks…

---

<div class="post-metadata">

**Author:** ![jebej](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jebej/32/1784_2.png) [@jebej](https://discourse.julialang.org/u/jebej)\
**Post date:** [May 2, 2017, 9:19pm UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484/2 "2017-05-02T21:19:40Z")

</div>

They render fine for me, although that was a few months ago:

> **[Jupyter Notebook Viewer](https://nbviewer.org/github/jebej/JaynesCummings.jl/blob/master/examples/JaynesCummings_01_GroundStates.ipynb)**
>
> Check out this Jupyter notebook!

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 2, 2017, 9:26pm UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484/3 "2017-05-02T21:26:19Z")

</div>

Yeah, notebook viewer usually works.

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [May 3, 2017, 3:58am UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484/4 "2017-05-03T03:58:36Z")

</div>

I notice that there’s no output after the `using PlotlyJS` cell. When the package is first imported it generates and runs some initialization javascript that’s important to the functioning of the plots. If you get rid of that output, your plots will still work locally (because the init code was already run), but if you re-open the notebook the plots may not work until you cause the init javascript to be re-run by running the `using` cell again.

Perhaps you got rid of that output in the notebook that nbviewer is loading? If so, try re-running that cell and leaving the output (you should see some text from PlotlyJS).

---

<div class="post-metadata">

**Author:** ![mirestrepo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mirestrepo/32/617_2.png) [@mirestrepo](https://discourse.julialang.org/u/mirestrepo)\
**Post date:** [May 3, 2017, 1:51pm UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484/5 "2017-05-03T13:51:26Z")

</div>

That was exactly the issue! I don’t recall getting rid of the output of that line intentionally, but once I made sure that output was part of the online version, it worked. Thank you!

---

<div class="post-metadata">

**Author:** ![sglyon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sglyon/32/67_2.png) [@sglyon](https://discourse.julialang.org/u/sglyon)\
**Post date:** [May 3, 2017, 2:03pm UTC](https://discourse.julialang.org/t/getting-plotlyjs-to-show-up-for-online-jupyter-notebooks/3484/6 "2017-05-03T14:03:09Z")

</div>

Yep – this is 100% correct. I wish I had a better solution to this, but that javascript needs to be executed whenever the browser loads the notebook. The only way this can happen is if that cell doesn’t get re-run and the js removed.
