# Interactive Julia plot of a compiled mathematical model

**URL:** <https://discourse.julialang.org/t/interactive-julia-plot-of-a-compiled-mathematical-model/111523>\
**Category:** Visualization\
**Tags:** question\
**Created:** [March 12, 2024, 2:54pm UTC](https://discourse.julialang.org/t/interactive-julia-plot-of-a-compiled-mathematical-model/111523 "2024-03-12T14:54:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marci93Bio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marci93bio/32/207701_2.png) [@Marci93Bio](https://discourse.julialang.org/u/Marci93Bio)\
**Post date:** [March 12, 2024, 2:54pm UTC](https://discourse.julialang.org/t/interactive-julia-plot-of-a-compiled-mathematical-model/111523/1 "2024-03-12T14:54:53Z")

</div>

Hello!

I’m having some trouble building an interactive plotting tool for my Julia code.

Here’s the problem:

I have a mathematical model implemented in Julia. I want to create a tool that plots the state variables and allows me to interactively change specific parameter values. Ideally, the plots should update automatically as I adjust the parameters with sliders or other controls.

What I’ve tried:

I used the `IJulia.jl` package with the `@manipulate` macro from `Interact.jl`. However, when I use a slider to change a parameter value, the plot doesn’t update.

Example Code (unsuccessful):

using Interact, Plots  
using WebIO, Conda, IJulia

jupyterlab() #to open a jupiter notebook

#then  
using Interact, Plots

@manipulate for lw = 1:0.1:10  
x = -3.14:0.1:3.14  
plot(x, sin.(x), linewidth=lw)  
end

In this example, I aimed to simply change the line width interactively, but the plot remains static.

My question:

Is there something I’m missing, or is there a better approach for achieving interactive plotting with parameter updates in Julia?

Thank you

---

<div class="post-metadata">

**Author:** ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Post date:** [March 12, 2024, 3:13pm UTC](https://discourse.julialang.org/t/interactive-julia-plot-of-a-compiled-mathematical-model/111523/2 "2024-03-12T15:13:30Z")

</div>

Have a look at [Pluto.jl](https://plutojl.org/)
