#lilaq tick label formatting

1 messages · Page 1 of 1 (latest)

wise geyser
#

Is there a way to add trailing zeroes/enforce a certain amount of sig figs in tick labels (i.e. have 1.00 instead of 1.0)? I am using the default linear tick locator which mentions significant-digits, but I can't seem to pass it anywhere that works.

Additionally is there a way to remove the .00 from the axis "suffix" (where it says .00 times 10^6)?

Locates linear ticks on an axis with range $[x_0, x_1]$.

#

?r

#import "@preview/lilaq:0.6.0" as lq
#import "@preview/zero:0.6.1": num, set-num, set-round, zi, ztable

#set-round(mode: "figures", precision: 3)
#set-num(exponent: (sci: 4))

#let m-1 = zi.declare("m^-1")

#let lambdas = (690, 590, 565, 505, 464)
#let lambda_invs = lambdas.map(n => 1e9 / n)
#let pds = (1.42, 1.52, 1.65, 1.90, 2.15)

#let grad = 1.1758E-06
#let int = -4.15E-01

#set page(flipped: true)
#lq.diagram(
  xlabel: [$lambda^(-1)$ / #m-1()],
  ylabel: [$V_T$ / #zi.V()],
  xlim: (1e6, 2.5e6),
  xaxis: (exponent: 6),
  lq.plot(
    mark: none,
    lq.linspace(1e6, 2.5e6),
    x => x * grad + int,
  ),
  lq.scatter(
    size: lambda_invs.map(n => 100),
    lambda_invs,
    pds,
  ),
)

quaint fog
#

hi, I'm sorry that you didn't get an answer here. If you post under the Lilaq tag in the Typst forum, you will definitely get an answer but i cannot follow this channel closely enough

#

The .00 is indeed a bug that is already fixed on main (and therefore in the next version).

#

The number of sigfigs cannot be increased unfortunately. What is your usecase for this need, if i may ask?