# Using \`plotlyjs\` backend inside Pluto notebook

**URL:** https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420
**Category:** General Usage
**Tags:** pluto, plotlyjs
**Created:** [March 4, 2022, 7:24pm UTC](https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420 "2022-03-04T19:24:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amit1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amit1/32/25318_2.png) [@amit1](https://discourse.julialang.org/u/amit1)
#### Post date: [March 4, 2022, 7:24pm UTC](https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420/1 "2022-03-04T19:24:44Z")

</div>

I have a Pluto notebook that grew somewhat in size, and now I want to plot some data in it. If I give `plotlyjs()` backend selection command in notebook I get error saying PlutoJS could not be found in environment. Which, as I understand, is due to notebook having own environment

> ArgumentError: Package PlotlyJS not found in current path:
> 
> - Run `import Pkg; Pkg.add("PlotlyJS")` to install the PlotlyJS package.
> 
> 1. **require** (::Module, ::Symbol)@ _loading.jl:967_
> 2. **top-level scope** @ _backends.jl:660_
> 3. **eval** @ _boot.jl:373_ [inlined]
> 4. **\_initialize\_backend** (::Plots.PlotlyJSBackend)@ _backends.jl:659_
> 5. **backend** (::Plots.PlotlyJSBackend)@ _backends.jl:176_
> 6. **#plotlyjs#250** @ _backends.jl:31_ [inlined]
> 7. **plotlyjs** @ _backends.jl:31_ [inlined]
> 8. **top-level scope** @ _[Local: 1](http://localhost:1234/edit?id=80e80f4c-9be8-11ec-1f06-bfbbb4ae057d#)_ [inlined]

But if I import both PlotlyJS and Plots, I get lots of namespace clashes.

Including the Pkg manually (as below ) disables established Notebook environment, and I get errors saying all previous imports are not available, and would require me to manually add and load in julia terminal.

```julia
begin
	import Pkg;
	Pkg.activate(Base.current_project())
	Pkg.instantiate()
	Pkg.add("PlotlyJS")
end

```

Error:

> ArgumentError: Package SphericalHarmonics not found in current path:
> 
> - Run `import Pkg; Pkg.add("SphericalHarmonics")` to install the SphericalHarmonics package.
> 
> 1. **require** (::Module, ::Symbol)@ _loading.jl:967_
> 2. **top-level scope** @ _[Local: 1](http://localhost:1234/edit?id=80e80f4c-9be8-11ec-1f06-bfbbb4ae057d#)_

Is there a workaround to it other than loading both libraries then using `Plots.plot` etc all the time?

I cannot use `PlotlyJS.plot` because that runs into WebIO error that has been reported on Github Issues.

---

<div class="post-metadata">

### Author: ![amit1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amit1/32/25318_2.png) [@amit1](https://discourse.julialang.org/u/amit1)
#### Post date: [March 4, 2022, 7:55pm UTC](https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420/2 "2022-03-04T19:55:04Z")

</div>

One possible solution I could find was

```julia
using Plots
import PlotlyJS as pltjs

plotlyjs()

plot ...

```

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [March 4, 2022, 8:10pm UTC](https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420/3 "2022-03-04T20:10:17Z")

</div>

Maybe this will help

[https://github.com/JuliaPluto/PlutoPlotly.jl](https://github.com/JuliaPluto/PlutoPlotly.jl)
