01.02.2014 Views

GNUPlot Manual

GNUPlot Manual

GNUPlot Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

50 gnuplot 4.0 33 REREAD<br />

32 Replot<br />

The replot command without arguments repeats the last plot or splot command. This can be useful<br />

for viewing a plot with different set options, or when generating the same plot for several devices.<br />

Arguments specified after a replot command will be added onto the last plot or splot command (with<br />

an implied ’,’ separator) before it is repeated. replot accepts the same arguments as the plot and splot<br />

commands except that ranges cannot be specified. Thus you can use replot to plot a function against<br />

the second axes if the previous command was plot but not if it was splot, and similarly you can use<br />

replot to add a plot from a binary file only if the previous command was splot.<br />

N.B. — use of<br />

plot ’-’ ; ... ; replot<br />

is not recommended. gnuplot does not store the inline data internally, so since replot appends new<br />

information to the previous plot and then executes the modified command, the ’-’ from the initial plot<br />

will expect to read inline data again.<br />

Note that replot does not work in multiplot mode, since it reproduces only the last plot rather than<br />

the entire screen.<br />

See also command-line-editing (p. 17) for ways to edit the last plot (p. 38) (splot (p. 154))<br />

command.<br />

See also show plot (p. 82) to show the whole current plotting command, and the possibility to copy<br />

it into the history (p. 36).<br />

33 Reread<br />

The reread command causes the current gnuplot command file, as specified by a load command or<br />

on the command line, to be reset to its starting point before further commands are read from it. This<br />

essentially implements an endless loop of the commands from the beginning of the command file to<br />

the reread command. (But this is not necessarily a disaster — reread can be very useful when used<br />

in conjunction with if. See if (p. 36) for details.) The reread command has no effect if input from<br />

standard input.<br />

Examples:<br />

Suppose the file "looper" contains the commands<br />

a=a+1<br />

plot sin(x*a)<br />

pause -1<br />

if(a

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!