How do I label the ends of a vector arrow with the coordinates in gnuplot? -
here's small script generate single 2d vector, , i'd put coordinates @ either end of arrow clearer when looking @ it.
set mxtics 5 set mytics 5 set xzeroaxis set yzeroaxis plot[y=-10:10][x=-10:10] "file.dat" using 1:2:3:4 vectors filled head lw 3 notitle
and here's file.dat
:
1 -3 -3 2
i've been looking forever , can't seem figure out how. first time i'm using gnuplot it's not coming easy.
i don't know way automagically, here workaround. first modify data file add labels coordinates:
1 -3 -3 2 "(1,-3)" "(-2,-1)"
then plot labels
, manually adjust offset make nice:
plot[y=-10:10][x=-10:10] 'file.dat' using 1:2:3:4 vectors filled head lw 3 notitle, \ '' using 1:2:5 labels offset 3,0, \ '' using 3:4:6 labels offset 0,-4
of course, skip fancy plot command , manually place labels coordinates.
Comments
Post a Comment