gpt4 book ai didi

gnuplot 将终端重置为默认输出

转载 作者:行者123 更新时间:2023-12-02 16:36:03 24 4
gpt4 key购买 nike

在 gnuplot 中,使用命令

set term pdf
set out 'filename.pdf'
plot sin(x)

允许我将图像写入 PDF。执行此操作后,如何重置输出,以便 plot sin(x) 使用内置 gnuplot 显示创建图像(因为它不需要使用 set out > 首先)。

现在我只能通过重新启动 gnuplot 来实现这一点。 reset 命令似乎没有帮助。谢谢大家!

最佳答案

除了其他答案之外,您还可以这样做:

set term pop
set output #reset standard output stream

一般来说,您可以使用以下方式保存当前正在使用的终端设置:

set term ... #what you want to save
set term push
set term ... #temporary terminal
set term pop #restore the terminal settings that you "pushed"

但是,如帮助设置终端中所述:

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.

关于gnuplot 将终端重置为默认输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15188997/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com