Which plotting library are you using? For the most part, points to plot are provided as a vector of x coordinates and a vector of y coordinates. In your case you could do this as:
plot(first.(points), last.(points)
where I’m assuming that points is the 2-element vector of length-2 tuples you posted above.
Annotations vary by plotting package, so again if you want specific advise you’ll need to tell us which package you’re using.
Thank you very much for the replies.
I’m using Plots.ji.
I’ve tried with the above one, but it returns the following.
This is only half of what I want.
Somehow, the scatter function is perceiving my input only as y1, but what I’m putting in is a 19-element vector of which each row is a two-dimension array. I want to label from y1 to y19, for instance.
using Plots, Printf
x = LinRange(0,1,19)
v = [(rand(0:9),rand(0:9)) for _ in 1:19]
plot(legend=:outerright)
for (i,t) in pairs(v)
scatter!(t, label=@sprintf("%.2f",x[i]))
end
Plots.current()