fraction
lq.tick-format.fraction(ticks, simplify: true, simplify-integers: true, suffix: none, suffix-position: "outside", omit-unity: true, tick-info: (:), ..args)(source)Formats linear ticks (see tick-locate.linear) with automatic fractions
when the tick distance is a fraction of 1.
#lq.diagram(
xlim: (-0.5, 1),
xaxis: (
tick-distance: 1 / 4,
format-ticks: lq.tick-format.fraction
)
)
A suffix like can be inserted for -based scales, see also
tick-locate.linear.
#lq.diagram(
xlim: (-calc.pi / 2, calc.pi),
xaxis: (
tick-distance: 1 / 4,
locate-ticks: lq.tick-locate.linear.with(unit: calc.pi),
format-ticks: lq.tick-format.fraction.with(suffix: $pi$)
)
)
Parameters
ticks : array
The ticks to format.
simplify : bool default: true
Whether to simplify fractions, like to .
simplify-integers : bool default: true
Whether to simplify integers − like to − and show no fraction.
suffix : content default: none
A suffix to display with each tick label, except with 0.
suffix-position : "outside" | "numerator" default: "outside"
Whether to place the suffix in the numerator or outside the fraction.
omit-unity : bool default: true
Whether to omit and in combination with a suffix, e.g., instead of .
tick-info : dictionary default: (:)
Additional information from the tick locator.
..args : any
Arguments that are ignored by this formatter.