gnuplot将终端重置为默认输出

Dou*_*ubt 5 gnuplot

在gnuplot中,使用命令

set term pdf
set out 'filename.pdf'
plot sin(x)
Run Code Online (Sandbox Code Playgroud)

允许我将图像写入pdf.在这样做之后,如何重置输出以便plot sin(x)使用内置的gnuplot显示创建图像(因为它在没有set out首先使用的情况下).

现在我只能通过重启gnuplot来实现这个目标.该reset命令似乎没有帮助.谢谢大家!

mgi*_*son 8

除了其他答案,你可以这样做:

set term pop
set output   #reset standard output stream
Run Code Online (Sandbox Code Playgroud)

通常,您可以使用以下方法保存当前正在使用的终端设置:

set term ... #what you want to save
set term push
set term ... #temporary terminal
set term pop #restore the terminal settings that you "pushed"
Run Code Online (Sandbox Code Playgroud)

但是,如下所述help set terminal:

该命令会set term pushset term pop恢复时记住当前终端及其设置.这相当于save termload term,但没有访问文件系统.因此,例如,它们可用于在打印之后实现终端的平台独立恢复.在gnuplot启动后,startup将自动推送默认终端或文件中的终端 .因此,可移植脚本可以依赖于set term pop恢复给定平台上的默认终端,除非已明确推送另一个终端.


par*_*ydr 4

假设您安装了 X11 版本的 gnuplot。将终端设置回 x11 并重置输出

set term x11
set out
Run Code Online (Sandbox Code Playgroud)