Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot reseting terminal to default output

Tags:

gnuplot

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!

like image 347
Doubt Avatar asked Mar 03 '13 18:03

Doubt


People also ask

What is the default terminal in gnuplot?

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.

What is terminal 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.


1 Answers

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 while set term pop restores it. This is equivalent to save term and load 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 from startup file is pushed automatically. Therefore portable scripts can rely that set term pop restores the default terminal on a given platform unless another terminal has been pushed explicitly.

like image 69
mgilson Avatar answered Oct 28 '22 06:10

mgilson