set terminal png set output 'plot.png' set xrange [-2:3] set yrange [-5:5] set xtics 1 set ytics 2 set title "Piece-wise continuous functions" f(x) = (x >= 2) ? (1.45 * x**3 - 6 * sqrt(x)) : 1/0 g(x) = (x >= -1 && x < 2) ? sin(x)**2 : 1/0 h(x) = (x < -1) ? abs(x) * exp(x) : 1/0 plot f(x) title "f(x) = 1.45x^3 - 6√x, x ≥ 2" lw 2 lc rgb "red", \ g(x) title "g(x) = sin^2(x), -1 ≤ x < 2" lw 2 lc rgb "blue", \ h(x) title "h(x) = |x| e^x, x < -1" lw 2 lc rgb "green"