#Piecewise function plot set terminal png size 400, 300 set output 'plot.png' #f(x) = 5*x for -3=2)? x**2 :(x>=-1 && x<2)? x: -1 pl f(x) w l lw 2