set terminal png set output 'plot.png' set xrange [0:pi] # or you can use set xrange [0:*] set yrange [-2:2] set xlabel "x-values" set ylabel "y-values" set title "Function plots" set samples 1000 # Define the functions f1(x) = sin(sqrt(x))**2 f2(x) = exp(-x/2)*cos(2*pi*x) f3(x) = 12.34*x**(5.0/3.0) # Plot the functions with different line styles and widths plot f1(x) title "f1(x)" lw 2 lc rgb "red", \ f2(x) title "f2(x)" lw 3 lc rgb "blue", \ f3(x) title "f3(x)" lw 4 lc rgb "green"