Skip to content

Commit

Permalink
Annotation domain fix (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf authored Oct 31, 2024
2 parents e618c25 + 1b0b33a commit 1425292
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plot.typ
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@

let axis = axis-dict.at(name)
let domain = if i == 0 {
d.at("x-domain", default: (0, 0))
d.at("x-domain", default: (none, none))
} else {
d.at("y-domain", default: (0, 0))
d.at("y-domain", default: (none, none))
}
if domain != (none, none) {
axis.min = util.min(axis.min, ..domain)
Expand Down
Binary file modified tests/plot/annotation/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions tests/plot/annotation/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@
})
})
})

#test-case({
import draw: *
set-style(rect: (stroke: none))

plot.plot(size: (6, 4), x-tick-step: 1, {
plot.add(domain: (100, 101), calc.sin)
plot.annotate(padding: .1, {
content( (101.5, 0), [A])
})
})
})

0 comments on commit 1425292

Please sign in to comment.