首页 > 解决方案 > Gnuplot:多个窗口中的多个绘图

问题描述

我想做多个与同一文件的不同数据列相关的图,但我想要每个图都有一个新窗口。我不想要与命令关联的附加图set multiplot layout 1,2。这个想法由以下伪代码表示:

>gnuplot

>plot "myfile.txt" u 1:4

>#make me plot another file without deleting the previous one i.e. open a new window on which data is plotted

>instructions I don't know

>plot "myfile.txt" u: ($3*$3) 

>#I obtain two windows

标签: plotgnuplotgnu

解决方案


你不写你正在使用哪个终端。我了解您希望两个窗口彼此相邻,而不是两个图形作为磁盘上的文件。在 gnuplot 控制台中检查例如:help wxt. 如果您想要磁盘上的两个文件,您必须选择另一个终端,例如

set term pngcairo
set output 'myOutput1.png'
plot x
set output 'myOutput2.png'
plot x**2
set output

因此,使用交互式 wxt 终端,以下内容对我有用:

代码:

### several terminals
reset session

set term wxt 1 size 500,400
plot sin(x)

set term wxt 2 size 500,300
plot cos(x)

set term wxt 3 size 300,200
plot x**2

### end of code

结果:

在此处输入图像描述


推荐阅读