Generated a small plot on a large canvas by specifying the margins at
screen.
Draw an arrow using graph coordinates that lie outside the axis range
arrow is drawn in the margin, well outside the graph:
set term postscript eps enhanced size 11in,8.5in
set nokey
set border 10
set xtics axis nomirror
set xzeroaxis lt 1
set tmargin at screen 0.412
set bmargin at screen 0.175
set rmargin at screen 0.869
set lmargin at screen 0.112
set arrow from graph 0, first 2.0 to graph 1, first 2.0 nohead lc 1
set out 'Test_arrow_OOB.eps'
plot sin(x)
thanks
I meant first coordinates (y axis coordinates)
Yes. gnuplot did exactly what you asked it to.
What else did you expect to happen?
> Is this expected behavior?
Yes. You can use "set clip" to control the clipping behaviour of
the plot itself, but that does not apply to separate elements like
labels, arrows, rectangles, etc.
If you want to draw arrows that are clipped to the plot
area, you would have to use a plot command:
plot sin(x), \
'-' using 1:2:3:4 with vectors
x0 y0 xdelta ydelta
e
Yes I was expecting it to clip to the plot I guess :) I did not think
that the axis would continue invisibly to the canvas limits.
Thanks for the hint on using the plot command!
Is there any possible way to clip labels to the plot? ie, not show
labels that are positioned outside the plot area?
thanks
Same answer: plot ... with labels
But the clipping is only applied to the anchor point of the label.
I.e., the label is either printed or not printed, it is not
truncated part-way through because it extends beyond the limit
of the plot area.
Thanks,
I want to specify the label position at a specifc y coord, and on the
right side of the graph, so I was using "label at graph 0.9, first [y-
value]"
"plot with ... labels" puts a label at the x,y coord. If the number of
points on my plot is variable, the x-position of the label will vary
when i plot with different sets of data.
To solve this problem I was able to use the built-in variable
GPVAL_X_MAX and offset from there.
> On Jan 30, 1:14 pm, sfeam <sf...@users.sourceforge.net> wrote:
>> Same answer: plot ... with labels
>>
>> But the clipping is only applied to the anchor point of the label.
>> I.e., the label is either printed or not printed, it is not
>> truncated part-way through because it extends beyond the limit
>> of the plot area.
>
> Thanks,
>
> I want to specify the label position at a specifc y coord, and on the
> right side of the graph, so I was using "label at graph 0.9, first [y-
> value]"
You could maybe use the x2 axis to accomplish the same thing:
set x2range [0:1]
plot 'datafile' with points, '-' using 1:2:3 x2y with labels \
1.0 yval "label contents"
e
thanks for the tips!