### 1.19 Plotting

There are three ‘gnuplot‘ commands which actually create a plot: ‘plot‘, ‘splot‘ and replot. ‘plot‘ generates 2D plots, ‘splot‘ generates 3D plots (actually 2D projections, of course), and replot appends its arguments to the previous ‘plot‘ or ‘splot‘ and executes the modified command.

Much of the general information about plotting can be found in the discussion of ‘plot‘; information specific to 3D can be found in the ‘splot‘ section.

‘plot‘ operates in either rectangular or polar coordinates – see ‘set polar‘ for details of the latter. ‘splot‘ operates only in rectangular coordinates, but the mapping command allows for a few other coordinate systems to be treated. In addition, the using option allows both ‘plot‘ and ‘splot‘ to treat almost any coordinate system you’d care to define.

‘plot‘ also lets you use each of the four borders – x (bottom), x2 (top), y (left) and y2 (right) – as an independent axis. The axes option lets you choose which pair of axes a given function or data set is plotted against. A full complement of ‘set‘ commands exists to give you complete control over the scales and labelling of each axis. Some commands have the name of an axis built into their names, such as xlabel. Other commands have one or more axis names as options, such as ‘set logscale xy‘. Commands and options controlling the z axis have no effect on 2D graphs.

‘splot‘ can plot surfaces and contours in addition to points and/or lines. See isosamples for information about defining the grid for a 3D function. See datafile for information about the requisite file structure for 3D data values, contour and cntrparam for information about contours.

In ‘splot‘, control over the scales and labels of the axes are the same as with ‘plot‘, except that commands and options controlling the x2 and y2 axes have no effect whereas of course those controlling the z axis do take effect.