Reputation: 3543
In gnuplot, we draw arrow as:
set arrow from 0,0 to 1,1
I want to make a plot with just arrows and no other data. How can I do this. Right now, after setting arrows, I need to give something to plot, since without that arrows don't get plotted. Is it possible to draw just an empty 'plot' without any data?
I have also seen online help on gnu etc., but could not get the answer resolved.
Upvotes: 9
Views: 26426
Reputation: 1959
If you set explicit axis ranges you can plot NaN
to get a clean set of axes.
Also, notitle
or t ''
is needed to hide the key for NaN
.
set xrange [0:5]
set yrange [0:5]
set arrow from 0,0 to 1,1
plot NaN t ''
Upvotes: 11
Reputation: 48390
To plot only an arrow with coordinates given in the units of the usual axes, one can use the vectors
plotting style.
# gnuplot 5
$data <<EOD
0 0 1 1
EOD
plot $data u 1:2:3:4 w vectors
or
# gnuplot 4.x
plot '-' u 1:2:3:4 w vectors
0 0 1 1
e
Upvotes: 1