Plots bug - arrows & xflip?

Consider:

plot(sin; lw=2, xlim=[0,2pi],label="")
plot!([(1,-0.5),(pi,0)]; lw=2, lc=:red, arrow=arrow(:closed, :head, 2.0, 2.0), label="")

providing (as expected):

But if I flip the x axis, I get something “wrong”…

plot(sin; lw=2, xlim=[0,2pi],label="", xflip=true)
plot!([(1,-0.5),(pi,0)]; lw=2, lc=:red, arrow=arrow(:closed, :head, 2.0, 2.0), label="")

with result:

Question: Is this a bug, or am I doing something wrong??

I’d classify that as at least an unhandled edge case. To work around in Plots

using Plots
gr()

"""
    arrow_segment_annot!(p, x1, y1, x2, y2; color=:red, lw=2, arrowsize=10)

Draw a line from (x1,y1) to (x2,y2) and put an arrowhead at (x2,y2)
as a rotated Unicode arrow annotation. Works even with xflip=true.
"""
function arrow_segment_annot!(p, x1, y1, x2, y2; color=:red, lw=2, arrowsize=10)
    # Draw the line
    plot!(p, [x1, x2], [y1, y2]; lc=color, lw=lw, label=nothing)

    # Compute angle in degrees in data space
    θ = atan(y2 - y1, x2 - x1) * 180 / π

    # Add an arrowhead annotation at the end
    annotate!(p, x2, y2, text('➤', arrowsize, color, rotation=θ))

    return p
end

# Example with flipped x-axis
p = plot(sin, 0, 2π; lw=2, label="", xlim=(0, 2π), xflip=true)
arrow_segment_annot!(p, 1, -0.5, π, 0.0; color=:red, lw=2, arrowsize=12)
display(p)

However, you can do this with less drama using CairoMakie

using CairoMakie

f(x) = sin(x)

fig = Figure(resolution = (600, 400))
ax  = Axis(fig[1, 1], xlabel = "x", ylabel = "y")

xs = range(0, 2π; length = 400)
lines!(ax, xs, f.(xs))

origin    = Point2f(1, -0.5)
target    = Point2f(π, 0.0)
direction = target - origin

arrows2d!(
    ax,
    [origin],
    [direction];
    color      = :red,
    shaftwidth = 2,
    tipwidth   = 10,
    tiplength  = 15,
)

ax.xreversed = true

fig

I should probably look more into Makie… Problem is many of the packages I use, take advantage of recipes in Plots.