Plots.jl icon indicating copy to clipboard operation
Plots.jl copied to clipboard

[FR] Arrow annotations

Open stevengj opened this issue 4 years ago • 6 comments

It would be nice to support adding arrow annotations to plots, similar to pyplot.arrow (from #245).

stevengj avatar Sep 20 '21 17:09 stevengj

I am not quite sure, what that function exactly is doing. Can you provide an example using PyPlot. First I thought this about marking points with arrows, but the example in the linked docs look like drawing an arrow with a label, which currently looks like this in Plots:

plot([(1,2), (2,3)], arrow=true, annotation=(1.45, 2.5, "label", 35.), legend=false)

BeastyBlacksmith avatar Sep 20 '21 19:09 BeastyBlacksmith

It just draws an arrow at an arbitrary position in the plot. Here's an example with PyPlot: image

stevengj avatar Sep 21 '21 20:09 stevengj

I'd say we already have that... the above would read as

using Plots
plot(0:4, sqrt.(0:4), color = :red, legend = false)
plot!([(1,1.5), (2,0.5)], arrow = arrow(:closed, 0.1), color = :blue)

Though backend support for this varies and I think we should add a version of arrow that works with keywords.

BeastyBlacksmith avatar Sep 22 '21 09:09 BeastyBlacksmith

@BeastyBlacksmith Mind if I work on this issue?

sarkarghya avatar Oct 01 '21 13:10 sarkarghya

No, Not at all :)

BeastyBlacksmith avatar Oct 01 '21 15:10 BeastyBlacksmith

It would be really great if the plotlyjs backend also supports these arrow constructions. Currently, the arrow attribute is not supported in the plotlyjs somehow.

BoundaryValueProblems avatar Mar 13 '22 22:03 BoundaryValueProblems