Credits | Overview | Plotting Styles | Commands | Terminals |
---|
The replot command without arguments repeats the last plot or splot command. This can be useful for viewing a plot with different set options, or when generating the same plot for several devices.
Arguments specified after a replot command will be added onto the last plot or splot command (with an implied ',' separator) before it is repeated. replot accepts the same arguments as the plot and splot commands except that ranges cannot be specified. Thus you can use replot to plot a function against the second axes if the previous command was plot but not if it was splot.
Note:
plot '-' ; ... ; replot
is not recommended, because it will require that you type in the data all over again. In most cases you can use the refresh command instead, which will redraw the plot using the data previously read in.
See also command-line-editing for ways to edit the last plot (splot) command.
See also show plot to show the whole current plotting command, and the possibility to copy it into the history.
In previous gnuplot versions, a complete multiplot could not be redrawn. The replot command reproduced only the final component plot of the full set. In gnuplot version 6 the commands used to generate a multiplot are stored into a datablock $GPVAL_LAST_MULTIPLOT. They can be replayed to regenerate the entire multiplot using the new command remultiplot.
EXPERIMENTAL (details may change in a subsequent gnuplot version): If the previously drawn plot was part of a multiplot, the replot command is now automatically treated as remultiplot. Several caveats apply. See new multiplots, remultiplot, set mouse multiplot.