# PlotlyJS backend (for Plots.jl) not loading plot

**URL:** <https://discourse.julialang.org/t/plotlyjs-backend-for-plots-jl-not-loading-plot/81964>\
**Category:** New to Julia\
**Tags:** question, plots, plotlyjs\
**Created:** [May 31, 2022, 7:26am UTC](https://discourse.julialang.org/t/plotlyjs-backend-for-plots-jl-not-loading-plot/81964 "2022-05-31T07:26:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dynamic/32/33773_2.png) [@dynamic](https://discourse.julialang.org/u/dynamic)\
**Post date:** [May 31, 2022, 7:26am UTC](https://discourse.julialang.org/t/plotlyjs-backend-for-plots-jl-not-loading-plot/81964/1 "2022-05-31T07:26:36Z")

</div>

Hello, I am plotting the bifurcation diagram for the logistic map f\_{\mu}(x)=\mu x (1-x) using the Plots.jl package, and would like to make it interactive with the plotlyjs() backend. However, when I try calling plotlyjs(), it gives me a blank plot. The code works fine when I use the default backend.

My program creates a vector of parameters, and then for every parameter it stores iterated values from an initial point into a matrix, which is then plotted against the parameters vector to create the bifurcation diagram. I figure the problem is my use of matrices, since I can use pyplotjs() in other programs, but I am not sure how to fix that issue. I have put my full code below if anyone would like to try it out. I am using the latest version of Julia.

```julia
using Plots
plotlyjs()

global x0=0.1 #initial value between 0 and 1
f(x,μ)=μ*x*(1-x) #logistic map

firstParam=0.01 #first paramater
lastParam=4 #last paramater
numParams = 2000 #number of parameters to graph
iter=2000 #number of iterations from initial value to get to attracting points
iterKeep=500 #number of iterations to graph

params=range(firstParam, lastParam, length=numParams) #paramaters

values=zeros(numParams) #initialize vector that will contain the iterations from initial point
for n in 1:numParams
    x=x0
    μ=params[n] #nth paramater
    for m in 1:iter
        x=f(x,μ) #iterate an iter amount of times
    end
    values[n]=x #store iterated value in "values"
end

orbit=zeros(numParams, iterKeep) #initialize matrix which will contain attracting points
for n in 1:numParams
    x=values[n]
    orbit[n,1]=x #set first point to f^[0](x)=x
    μ=params[n]
    for m in 2:iterKeep #set mth point to be f^[m-1](x)
        x=f(x,μ)
        orbit[n,m]=x #store value
    end
end

scatter(params, orbit, markersize=0.01, legend=false, color=false, title="Bifurcation Diagram", xlabel="Parameters", ylabel="Attractors")
#plot points, set graphical size of points to 0.01 pixels, remove legend, make the graph color black, and label the graph.

```

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 31, 2022, 7:59am UTC](https://discourse.julialang.org/t/plotlyjs-backend-for-plots-jl-not-loading-plot/81964/2 "2022-05-31T07:59:34Z")

</div>

Your example seems to have too many points for the `plotlyjs` backend to handle. It will eventually plot your example (you need to increase the marker size) after a long wait, but the interaction will also be very slow. If you reduce the iterations and plot with a larger marker size, you will see that it works and faster.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 31, 2022, 8:08am UTC](https://discourse.julialang.org/t/plotlyjs-backend-for-plots-jl-not-loading-plot/81964/3 "2022-05-31T08:08:51Z")

</div>

You could try the `inspectdr()` backend, that handles well your example.

Check first [the keybindings](https://github.com/ma-laforge/InspectDR.jl/blob/master/doc/input_bindings.md) for smooth interaction with the plot.

---

<div class="post-metadata">

**Author:** ![dynamic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dynamic/32/33773_2.png) [@dynamic](https://discourse.julialang.org/u/dynamic)\
**Post date:** [May 31, 2022, 8:20am UTC](https://discourse.julialang.org/t/plotlyjs-backend-for-plots-jl-not-loading-plot/81964/4 "2022-05-31T08:20:14Z")

</div>

Thank you, `inspectdr()` works well. I will still have to reduce the iterates (I probably should have realized this was the problem), but it handles the diagram much better.
