Hi everyone!
I am creating a plot with two Y-axes (left and right) using lilaq:0.6.0. Here is my minimal working example:
#import "@preview/lilaq:0.6.0" as lq
#let tovu = lq.color.map.magma
#let colors = (tovu.at(2), tovu.at(6))
#lq.diagram(
width: 15cm,
height: 7cm,
xlabel: [Time],
yaxis: none,
margin: (x: 2%),
cycle: colors,
lq.yaxis(
position: left,
label: text(fill: tovu.at(2))[Voltage],
stroke: tovu.at(2),
lq.plot(
range(0, 4),
range(0, 4),
mark: none,
stroke: 2pt,
),
),
lq.yaxis(
position: right,
label: text(fill: tovu.at(6))[Current],
stroke: tovu.at(6),
lq.plot(
range(0, 40),
range(0, 40),
mark: none,
stroke: 2pt,
),
),
)
I have two questions regarding axis styling:
- Is there a way to make an axis (its line, label, and tick numbers) automatically inherit/take the color of its associated plot or the current color from
cycle, so I don’t have to specifystrokeandfillmanually for every axis and label? - What is the recommended way to color the tick numbers (labels) on each Y-axis to match its axis line (
stroke)? I tried using show rules withlq.tick-label, but sincekind: "y"matches both the left and right axes, it applies the color to both sides simultaneously instead of distinguishing between them.
Thanks in advance for any advice!