Why is box “B” placed the way it is? I would have expected the box to be with its southwest corner at (0,0).
#import "@preview/cetz:0.4.2": canvas, draw
#import "@preview/cetz-plot:0.1.3": plot
#canvas(length: 1cm, {
let (cos, sin) = (calc.cos, calc.sin)
let A = 1.05
draw.set-style(axes: (
minor-grid: (stroke: gray.lighten(70%) + 0.1pt)
))
plot.plot(
size: (6, 6),
x-minor-tick-step: 0.1,
y-minor-tick-step: 0.1,
x-min: -A, x-max: A, x-tick-step: 0.5, x-grid: "both",
y-min: -A, y-max: A, y-tick-step: 0.5, y-grid: "both",
{
plot.annotate({
draw.content((0,0), box("A", stroke:1pt))
draw.content((0,0), box("B", stroke:1pt), anchor:"south-west", padding:0)
})
plot.add(
domain: (0, 2 * calc.pi),
t => (cos(t), sin(t)),
fill: true,
style: (fill: blue.lighten(95%),
stroke: blue)
)
}
)
})
