How can I have different tick sizes on the x-axis and y-axis in lilaq?

I am trying to produce a graph in which there are tick marks on the y-axis but not on the x-axis.

I’m not sure if this is possible with lilaq currently, but I’d ideally like to be able to have a lq.set-tick-y(outset: 4pt) and a lq.set-tick-x(outset: 0pt)

Is there a way of achieving this goal with lilaq at the moment?

#import "@preview/lilaq:0.6.0" as lq  

#show: lq.set-tick(inset: 0pt, outset: 4pt, stroke: black, shorten-sub: 50%)
#show: lq.cond-set(lq.grid.with(kind: "x"), stroke: none)

#lq.diagram(
  xaxis: (
    mirror: (ticks: false),
    subticks: none,
    label: [number of bananas]
  ),
  yaxis: (
    mirror: (ticks: false),
    subticks: 1,
    label: [frequency]
  ),
  lq.bar(
    (1, 2, 3, 4),
    (4, 11, 3, 9),
  )
)

The way would be show tick.where(kind: "x"): set tick(outset: 0pt) but this does not work currently, see How to hide ticks on one axis while preserving labels in Lilaq? - #3 by Andrew.

Thanks @Mc-Zen - is this something that we need to wait until Typst supports user-defined types? (And do you happen to know if there is a timeline on that feature in Typst?)

Hi @Bryn ,
Exactly! With user-defined types, this won’t be a problem anymore. The team has stated in the previous community call that user defined types may become a priority for the version after the next one (i.e. for 0.16). But as for when this be exactly, I think no one could give a precise answer, including the team.

2 Likes