set xrange [-1:3] set autoscale y f(x) = 0<=x && x<1 ? sin(x) : 1<=x && x<2 ? 1/x : 1/0 plot f(x)