Interactive and reactive plots with Makie
Makie
—in particular, its GLMakie
backend—was designed to be interactive. Makie
builds its interactivity around the Observables
package. For example, Makie
arguments and attributes can be observables, so the plot automatically reacts to their changes. What is more, Makie
extends Observables
to make actions helpful in creating more straightforward interactive visualizations. In this section, through an example, we will learn how to create a simple interactive plot while exploiting the tools offered by Makie
. We will plot an arc with GLMakie
using a slider to choose the internal angle value. Proceed as follows:
- Open the Julia REPL on a terminal and execute
using GLMakie
, to useMakie
and its Open Graphics Library (OpenGL) backend. Depending on your machine or the need for precompilation, this step and the following two can take some time. - Execute
fig = Figure()
to create a new figure. TheFigure
objects ofMakie
contain...