Next: , Previous: mouse, Up: set-show


2.19.37 multiplot

The command multiplot places `gnuplot` in the multiplot mode, in which several plots are placed on the same page, window, or screen.

Syntax:

           set multiplot
           unset multiplot
     

For some terminals, no plot is displayed until the command multiplot is given, which causes the entire page to be drawn and then returns `gnuplot` to its normal single-plot mode. For other terminals, each separate `plot` command produces a plot, but the screen may not be cleared between plots.

Any labels or arrows that have been defined will be drawn for each plot according to the current size and origin (unless their coordinates are defined in the `screen` system). Just about everything else that can be `set` is applied to each plot, too. If you want something to appear only once on the page, for instance a single time stamp, you'll need to put a `set time`/`unset time` pair around one of the `plot`, `splot` or replot commands within the multiplot/multiplot block.

The commands origin and size must be used to correctly position each plot; see origin and size for details of their usage.

Example:

           set size 0.7,0.7
           set origin 0.1,0.1
           set multiplot
           set size 0.4,0.4
           set origin 0.1,0.1
           plot sin(x)
           set size 0.2,0.2
           set origin 0.5,0.5
           plot cos(x)
           unset multiplot
     

displays a plot of cos(x) stacked above a plot of sin(x). Note the initial size and origin. While these are not always required, their inclusion is recommended. Some terminal drivers require that bounding box information be available before any plots can be made, and the form given above guarantees that the bounding box will include the entire plot array rather than just the bounding box of the first plot.

size and origin refer to the entire plotting area used for each plot. If you want to have the axes themselves line up, you can guarantee that the margins are the same size with the margin commands. See margin for their use. Note that the margin settings are absolute, in character units, so the appearance of the graph in the remaining space will depend on the screen size of the display device, e.g., perhaps quite different on a video display and a printer. See also multiplot demo (multiplt.dem).