How to annotate with arrows in Julia Plots?

Is there a way to achieve annotations similar to matplotlib without switching the backends for Plots? I am especially looking for a way to annotate with arrows. The current method as seen in docs seems to support only text.

I found a way to add arrows manually but I wonder if there’s an easier or straightforward way to get such annotations.

You could use Plots.jl pyplot() backend with those specific annotation functions.
Otherwise you may use quiver! and annotate!, which work for several Plots.jl backends. A basic example follows:

using Plots; gr()
plot(sin, 0:0.1:2π, label="sin(x)")
quiver!([π + 1], [0.2], quiver=([-1], [-0.2]))
annotate!([π + 1], [0.3],"sin(x)=0")

4 Likes