Guide.annotation

Overlay a plot with an arbitrary Compose graphic. The context will inherit the plot's coordinate system, unless overridden with a custom unit box.

Arguments

Examples

plot(sin, 0, 2pi,
     Guide.annotation(
       compose(context(), circle([pi/2, 3*pi/2], [1.0, -1.0], [2mm]), fill(nothing),
       stroke(colorant"orange"))))
x 0 2 4 6 8 -1.0 -0.5 0.0 0.5 1.0 f(x)