Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Marking coordinates of the points plotted using gnuplot

Tags:

graph

gnuplot

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?

like image 465
gonephishing Avatar asked Jul 28 '26 01:07

gonephishing


1 Answers

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

enter image description here

like image 76
sweber Avatar answered Jul 30 '26 02:07

sweber



Donate For Us

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