I want to plot my graph that connects a few point using 'linespoints'
I also want a label against each of the plotted point marking the coordinate of the plotted point. If possible draw a line along x and y axis marking the coordinates of the plotted points.
Any help?
You can use the with vectors option to draw arrows from column 1 & 2 with the length given in column 3 & 4. The nohead removes the arrow tips. And with labels you can place a string given as third column. The left causes left aligned text (i.e. right of the coordinates), and the offset moves the text one character width to the right.
plot "data.csv" u 1:2 with linespoints, \
'' u 1:2:(0):(-$2) with vectors, \
'' u 1:2:(-$1):(0) with vectors nohead, \
'' u 1:2:(sprintf("x=%.1f; y=%.1f", $1, $2)) with labels left offset 1, 0

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With