How to plot two functions in non-overlapping regions? - Gnuplot Programming

How to plot two functions in non-overlapping regions?



- Parametric plot can be used to plot 2 functions in non-overlapping regions.

- Following examples illustrates:
gnuplot> set parametric
gnuplot> aaf=1
gnuplot> bb=3
gnuplot> cc=2
gnuplot> dd=4
gnuplot> x1(t) = aa+(bb-aa)*t
gnuplot> x2(t) = cc+(dd-cc)*t
gnuplot> f1(x) = sin(x)
gnuplot> f2(x) = x**2/8
gnuplot> plot [t=0:1] x1(t),f1(x1(t)) title "f1", x2(t), f2(x2(t)) title "f2"

- The last line of code is parametric plot that plots the functions x1 and f1, x2 and f2.
Post your comment