Interactive Julia plot of a compiled mathematical model


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

using Interact, Plots

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

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

Have a look at Pluto.jl