1
votes

Here is provided an example of line breaking in a plot drawn with Gnuplot.

Using arrows, as suggested in the link above, the results depend by the axis, i.e. I can't handle the angle of the arrow with simplicity. The following figure shows an example of an ugly line breaking obtained by the example in the link above. enter image description here

To obtain that ugly arrows, I did something like:

x1 = 32
yb = 0
yt = 100
tiny=2
set arrow 1 from x1-tiny, yb-tiny to x1+tiny, yb+tiny nohead
set arrow 2 from x1-tiny, yt-tiny to x1+tiny, yt+tiny nohead

for the first plot and:

x2 = 33
set arrow 1 from x2-tiny, yb-tiny to x2+tiny, yb+tiny nohead
set arrow 2 from x2-tiny, yt-tiny to x2+tiny, yt+tiny nohead

for the second.

Hence, instead of using arrows, I wish to use a symbol to be put at the end of the axis. A symbol is in pt and doesn't change with the axis length. I think it should be done by putting a label centered into a specific point.

Which is the code to do that in Gnuplot?

2

2 Answers

2
votes

Try the following lines for the first and the latter plot, respectively:

set label "/" at x1, yb center font "Symbol,24"
set label "/" at x1, yt center font "Symbol,24"

set label "/" at x2, yb center font "Symbol,24"
set label "/" at x2, yt center font "Symbol,24"

This should work!

0
votes

the trick to specifying your arrows at fixed angles is to work in graph coordinates.

(Note my split axis approach does not work right with the postscipt driver..not sure why)

set terminal png
set yrange [0:20]
set multiplot
set ytics nomirror
set xrange [0:10]
set border 7  #left,top,bottom
set key left
dy = .025  #height of slash in graph coordinates
dx = dy/tan(10*pi/180)  # 10 degree angle
set arrow nohead lt -1 from graph 1-dx,-dy to graph 1+dx,dy
set origin 0,0
set size .5,.8 
set xtics (0,4,8)
plot sqrt(x)
set origin .5,0
set xrange [100:200]
set border 13 #right,top,bottom
unset ytics
set nokey
unset arrow
set arrow nohead lt -1 from graph -dx,-dy to graph dx,dy 
set xtics (125,150,175,200)
plot sqrt(x)

Note this will work just fine if you have log scales..

enter image description here

oops forgot the top, for that you just do

set arrow nohead lt -1 from graph 1-dx,-dy+1 to graph 1+dx,dy+1