# Example 9
# Two Simple Examples of Function Splicing
reset
set multiplot
width=9
set terminal eps
set output 'examples/eps/example9.eps'
set width width

# Plot 0 (bottom left)
f(x)[-2:7] = sin(x)
set xlabel 'x'
set ylabel 'y'
set xrange [-10.9:10.9]
set label 1 '(a)' -9,0.8
plot f(x)

# Plot 1 (bottom right)
g(x,a)      =  a/10
g(x,a)[:-a] = -a/10
g(x,a)[a:]  = -a/10

set ylabel 'linkaxis 0'
set label 1 '(b)' -9,0.8
set origin width,0
set key bottom xcentre
plot g(x,2), g(x,5), g(x,7)

# Produce a gif copy
set term gif
set output 'examples/eps/example9.gif'
refresh
