Marking coordinates of points plotted using gnuplot
I want to plot a graph that connects multiple points using 'linespoints'.
I also want a label on each of the points I have drawn to indicate the coordinate of the point I have drawn. If possible, drag a line along the x and y axis to indicate the coordinates of the plotted points.
Any help?
source to share
You can use the option with vectors
to draw arrows from columns 1 and 2 with the length specified in columns 3 and 4. nohead
removes arrow tips. And with labels
you can put the row specified as the third column. Left invokes left-aligned text (that is, right coordinates), and offset moves the text one character wide 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
source to share