5.1 CairoMakie.jl

Let’s start with our first plot, some scatter points with lines between them:

using CairoMakie
CairoMakie.activate!()
fig = scatterlines(1:10, 1:10)
Figure 4: First plot.

Note that the previous plot is the default output, which we probably need to tweak by using axis names and labels.

Also note that every plotting function like scatterlines creates and returns a new Figure, Axis and plot object in a collection called FigureAxisPlot. These are known as the non-mutating methods. On the other hand, the mutating methods (e.g. scatterlines!, note the !) just return a plot object which can be appended into a given axis or the current_figure().

The next question that one might have is: how do I change the color or the marker type? This can be done via attributes, which we do in the next section.



CC BY-NC-SA 4.0 Jose Storopoli, Rik Huijzer, Lazaro Alonso