Reputation: 2483
We can draw an arrow using:
set arrow 1 from 0,-5 to 0,5
However, the from and to positions are using the x1y1 axis.
How can I let the positions use the x1y2 axis? I have a y2 axis different from y1 axis.
Upvotes: 2
Views: 3227
Reputation: 105
However, X2 does not inherit everything exactly the same from X if X2 is not set e.g. if you have set xdata time
. This must also be set manually if you want to use the same time format for your arrows. More importantly, if you have X2 tics off (for a cleaner graph), the X2 scale may not be quite the same, so the arrows will move about, or sometimes be slightly differently placed. You may need to do something like this:-
set x2data time ; # So we can ref second
set x2range [GPVAL_X_MIN:GPVAL_X_MAX] ; # But X2 needs exactly the same exact scale (set x2tics is another way)
set arrow 2 from second "201710300000",5050 to second "201710282330",5590
Upvotes: 1
Reputation: 7627
Use the second
coordinate system:
# Set different ranges for y1 and y2
set y2range [-1:1]; set yrange [-10:10]; set xrange [-2*pi:2*pi]; set y2tics
set multiplot layout 2,1
# Set arrow using x1y1 coordinate system
set arrow 1 from 0,0 to 1,1
plot sin(x)
# Set arrow using x2y2 coordinate system (x2 = x1 because x2 is not set)
set arrow 1 from second 0,0 to second 1,1
plot sin(x)
You can see the difference:
Upvotes: 5