In gnuplot, using the commands
set term pdf
set out 'filename.pdf'
plot sin(x)
allows me to write the image to a pdf. After doing so, how do I reset the output so that plot sin(x)
creates the image using the built-in gnuplot display (as it does without ever have using set out
in the first place).
Right now I can only acheive this by restarting gnuplot. The reset
command does not seem to help. Thanks all!
News: the default terminal is set to 'wxt' terminal instead of the traditional 'windows' terminal. The default terminal can be controlled by setting the 'GNUTERM' environmental variable or by putting 'set term windows|wxt' into gnuplot.
gnuplot is a command-driven interactive function plotting program. It can be used to plot functions and data points in both two- and three- dimensional plots in many different formats. It is designed primarily for the visual display of scientific data.
In addition to the other answer, you could do:
set term pop
set output #reset standard output stream
In general, you can save the terminal settings you're currently working one using:
set term ... #what you want to save
set term push
set term ... #temporary terminal
set term pop #restore the terminal settings that you "pushed"
However, as documented in help set terminal
:
The command
set term push
remembers the current terminal including its settings whileset term pop
restores it. This is equivalent tosave term
andload term
, but without accessing the filesystem. Therefore they can be used to achieve platform independent restoring of the terminal after printing, for instance. After gnuplot's startup, the default terminal or that fromstartup
file is pushed automatically. Therefore portable scripts can rely thatset term pop
restores the default terminal on a given platform unless another terminal has been pushed explicitly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With