Writing plotting recipes for Makie
Makie also offers a lightweight recipe system thanks to the MakieCore
package. This package only depends on the Observables
package to allow interactivity. As of MakieCore
version 0.3.5, Makie provides two kinds of recipes: type and full recipes. Type recipes in Makie are similar to the ones of Plots
, as they can convert a user-defined type into something Makie can plot. They also allow us to specify the default plot type for that custom type. Full recipes in Makie, on the other hand, are like Plots’ series recipes. Makie uses this full recipe to define many plot types, such as hlines
and vlines
. Sadly, they do not offer a high-level API to control the plot layout as Plots’ plot recipes do.
Type recipes are defined thanks to the convert_arguments
function. When Makie calls the plot
function with an unknown type, it will try to convert it into something it can plot by calling that function using a PlotType
; for example, Scatter
, in...