# ControlSystems + PlotlyJS

**URL:** https://discourse.julialang.org/t/controlsystems-plotlyjs/91898
**Category:** Modelling & Simulations
**Tags:** plotlyjs, plot, controlsystems
**Created:** [December 20, 2022, 2:34pm UTC](https://discourse.julialang.org/t/controlsystems-plotlyjs/91898 "2022-12-20T14:34:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![stephans3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephans3/32/34552_2.png) [@stephans3](https://discourse.julialang.org/u/stephans3)
#### Post date: [December 20, 2022, 2:35pm UTC](https://discourse.julialang.org/t/controlsystems-plotlyjs/91898/1 "2022-12-20T14:35:00Z")

</div>

I just read in this post  
[Implementation of matlab function in julia (Root locus plot)](https://discourse.julialang.org/t/implementation-of-matlab-function-in-julia-root-locus-plot/91662/11)  
that it is possible to use ControlSystems together with PlotlyJS.  
To use `plotlyjs()` the package `PlotlyJS`has to be installed.

```julia
using ControlSystems, Plots
plotlyjs()
G = tf([5], [1, 6, 5, 1])

```

These plots work with PlotlyJS:

```julia
nyquistplot(G)
rlocusplot(G, c=:blue)
plot(step(feedback(G),10))

```

See also for `nyquistplot`:  
[https://juliacontrol.github.io/ControlSystems.jl/stable/lib/plotting/#ControlSystemsBase.nyquistplot](https://juliacontrol.github.io/ControlSystems.jl/stable/lib/plotting/#ControlSystemsBase.nyquistplot)

However, the Bode plot does not work:

```julia
bodeplot(G)

```

Probably because it consists of 2 sub-plots?

I think it is great to have this hover feature but I have not known this before and it is not explicitly explained in the docs. So, it would be very nice to have an explanation in the docs for using PlotlyJS.  
I guess some other users are interested in using PlotlyJS with ControlSystems as well 🙂

See also this issue on Github:  
[#785 rlocusplot shows a very long warning with Plots](https://github.com/JuliaControl/ControlSystems.jl/issues/785)

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [December 20, 2022, 4:44pm UTC](https://discourse.julialang.org/t/controlsystems-plotlyjs/91898/2 "2022-12-20T16:44:42Z")

</div>

Plots.jl has multiple different backends and they all have slightly different feature sets. We do nothing to handle the variance between backends and instead rely on Plots.jl doing this for us. I thus suggest consulting the docs for whatever backend you prefer to learn about their features. If our recipes miss something that would be nice to have, please open an issue or a PR and we might be able to add it.

I’ve never used plotlyjs, but plotly has always worked very well for me, including the Bode plot.
