Skip to content

Commit

Permalink
Compute correct position for manual ticks when using log mode (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf authored Feb 24, 2025
2 parents bdc0900 + 55661cd commit 8516672
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/axes.typ
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,13 @@
#let value-on-axis(axis, v) = {
if v == none { return }
let (min, max) = (axis.min, axis.max)
let dt = max - min; if dt == 0 { dt = 1 }
if axis.mode == "log" {
min = calc.log(min)
max = calc.log(max)
v = calc.log(v)
}

let dt = max - min; if dt == 0 { dt = 1 }
return (v - min) / dt
}

Expand Down

0 comments on commit 8516672

Please sign in to comment.