plot sin(x)Several functions may be plotted on the same graph by separating them with commas, e.g.
plot sin(x), cos(x)All the C library functions are recognized, and you can also define your own, e.g.
f(x) = x*x*sin(pi*x) plot f(x)(the value pi is built in). The x-range of the graph is set by gnuplot by default. Use
plot [-2*pi:4*pi] sin(x)to set it yourself. (Note that gnuplot will evaluate arithmetic expressions it encounters.) Alternatively, use the command
set xrange [-2*pi:4*pi]before the plot command to accomplish the same thing. The same applies for yrange. To restore the default range, use
set xrange restore
To increase the resolution of the plot, use
set sample <interval>The default interval is 100; increasing the number gives a smoother graph.
Some other useful commands in this context are
Numerous line and point styles are available, as described here.