Now suppose you would want to insert custom horizontal lines between :eGFR values of 30 and 100 to draw attention to observations inside and outside this range.
Here we are passing the first and only positional argument to mapping since HLines only takes a single positional argument as a vector of the ys values that we want to draw a horizontal line at.
Notice that the procedure to have vertical lines is the same, but with VLines instead:
plt_vlines =mapping([30, 100]) *visual(VLines);
draw(plt + plt_vlines)
2 🎨 Customizing VLines and HLines
By default, VLines and HLines will use the colors from AoG.jl’s default theme palette (or any other custom palette you’ve set as the theme’s default).
Suppose you’ll want to customize the lines being drawn by VLines and HLines. You can use the same keyword arguments as Lines plotting type:
Tip
We use the plotting type in AoG.jl (Lines) but to get the attributes we call Makie.jl’s plotting function (lines).
So let’s create the previous horizontal lines between :eGFR values of 30 and 100, but with linewidth set to 3, linestyle to :dash and color being :red with alpha 0.7:
You can also fill vertical or horizontal regions of your plots with VSpan and HSpan, respectively.
The logic is similar as VLines and HLines. The first and second positional arguments inside the mapping are ys_low/xs_low and ys_high/xs_high, both being a vector of length-1 to specify the minimal or maximal lower bounds of either the horizontal or vertical regions.
Let’s fill the range that we’ve depicted in our last plot, between :eGFR values of 30 and 100: