fill-between
Fills the area between two graphs.
#let xs = lq.linspace(-1, 2)
#lq.diagram(
lq.fill-between(
xs,
xs.map(calc.sin),
y2: xs.map(calc.cos),
)
)
or the area between one graph and the -axis:
#let xs = lq.linspace(0, 3, num: 80)
#lq.diagram(
lq.fill-between(
label: [Maxwell-distribution],
xs,
xs.map(x => x*x*calc.exp(-x*x*1.3)),
)
)
Parameters
x : array
An array of data coordinates. Data coordinates need to be of type int or float.
y1 : array | function
Specifies either an array of coordinates or a function that takes an
x value and returns a corresponding y coordinate. The number of
and coordinates must match.
y2 : none | array | function default: none
An second array (or function) of data coordinates. If this is none,
the area between the coordinates y1 and the -axis is filled.
stroke : none | stroke default: none
How to stroke the area.
fill : none | color | gradient | tiling default: auto
How to fill the area.
step : none | start | end | center default: none
Step mode for plotting the lines. See plot.step.
label : content default: none
The legend label for this plot. See plot.label.
z-index : int | float default: 2
Determines the position of this plot in the order of rendered diagram
objects. See plot.z-index.