grid
An axis grid for highlighting tick positions in the diagram area. The grid lines are determined from the ticks located by the tick locators of the main and axes for vertical and horizontal grid lines, respectively.
One way to set up the grid stroke is with a style rule. The stroke
for the grid lines at the main ticks is controlled by grid.stroke
and the stroke of the subticks by grid.stroke-sub
:
#show: lq.set-grid(
stroke: teal,
stroke-sub: 0.5pt + luma(90%)
)
#lq.diagram(
)
Through the parameter diagram.grid
, the look of the grid can also be
controlled directly for an individual diagram.
#lq.diagram(
grid: (stroke: black, stroke-sub: 0.25pt)
)
Here you can also pass none
to deactivate the grid entirely (equivalent
to #show: lq.set-grid(stroke: none)
).
In order to address the and grid individually, use cond-set
#show: lq.cond-set(lq.grid.with(kind: "x"), stroke: orange)
#lq.diagram(
width: 4.5cm, height: 3cm
)
ticks : array
A list of tick positions as absolute length coordinates within the
diagram frame. This is automatically filled by diagram
with the ticks
resulting from the axes' tick locators.
sub : bool
Whether the ticks passed to grid.ticks
are subticks.
kind : "x"
| "y"
default: "x"
The axis kind: horizontal ("x"
) or vertical ("y"
).
stroke : none
| stroke
default: 0.5pt + luma(80%)
How to stroke grid lines.
stroke-sub : auto
| none
| stroke
default: none
How to stroke grid lines for subticks. If auto
, the style is inherited
from grid.stroke
.
z-index : int
| float
default: 0
Determines the position of the grid in the order of rendered diagram
objects. See plot.z-index
.