From dd3f2d6aab002fab19b91715cd9034c3ae87c7fc Mon Sep 17 00:00:00 2001 From: 2211567 Date: Wed, 18 Jun 2025 10:59:17 +0200 Subject: [PATCH] added colorbar next to heatmap --- src/visualization.jl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/visualization.jl b/src/visualization.jl index 102a44f..ddbf638 100644 --- a/src/visualization.jl +++ b/src/visualization.jl @@ -79,7 +79,8 @@ end """ multi_step!(state, n_steps, heat_obs::Observable, params_obs::Observable; step_method=step_gray_scott!, dx=1) - returns a new matrix for the heatmap for n steps of computing with the corresponding step_method + returns a new matrix for the heatmap for n steps of computing with the corresponding step_method. + The step_methods have different names because switching models via multi-dispatching is too complex. # Arguments: - `state`: activator and inhibitor matrices @@ -111,14 +112,18 @@ end function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs) reset!(U, V, heat_obs) - fig = Figure(size=(1300, 950)) + fig = Figure(size=(1500, 950)) gh = GridLayout(fig[1, 1]) dropdown = Menu(fig, options=collect(zip(["Gray-Scott", "FHN"], [:gray_scott, :fhn]))) gh[1, 1] = dropdown - ax = Axis(gh[2, 1]) + plotgrid = GridLayout() + gh[2, 1] = plotgrid + + ax = Axis(plotgrid[1, 1]) + hm = heatmap!(ax, heat_obs, colormap=:viridis) + plotgrid[1, 2] = Colorbar(fig, hm, label="Inhibitor ⇒ Activator") - hm = Makie.heatmap!(ax, heat_obs, colormap=:viridis) deactivate_interaction!(ax, :rectanglezoom) ax.aspect = DataAspect()