# Piecewise function with or condition set terminal png size 600, 400 set output 'plot.png' f(x) = (x < -1 || x > 1) ? 0 : x set xrange [-2:2] set yrange [-2:2] plot f(x) w l lw 2