Skip to content

Commit c091118

Browse files
committed
tests: Add test for rotated annotation
1 parent 4c6d585 commit c091118

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/plot/annotation/ref/1.png

16.6 KB
Loading

tests/plot/annotation/test.typ

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,24 @@
2323
})
2424
})
2525
})
26+
27+
#test-case({
28+
import draw: *
29+
set-style(rect: (stroke: none))
30+
31+
plot.plot(size: (6, 4), x-horizontal: false, y-horizontal: true, {
32+
plot.add(domain: (-calc.pi, 3*calc.pi), calc.sin)
33+
plot.annotate(background: true, {
34+
rect((0, -1), (calc.pi, 1), fill: blue.lighten(90%))
35+
rect((calc.pi, -1.1), (2*calc.pi, 1.1), fill: red.lighten(90%))
36+
rect((2*calc.pi, -1.5), (3.5*calc.pi, 1.5), fill: green.lighten(90%))
37+
})
38+
plot.annotate(padding: .1, {
39+
line((calc.pi / 2, 1.1), (rel: (0, .2)), (rel: (2*calc.pi, 0)), (rel: (0, -.2)))
40+
content((calc.pi * 1.5, 1.5), $ lambda $)
41+
})
42+
plot.annotate(padding: .1, {
43+
line((calc.pi / 2,-.1), (calc.pi / 2, .8), mark: (end: "stealth"))
44+
})
45+
})
46+
})

0 commit comments

Comments
 (0)