如何解决GNUPLOT replot问题

如何解决GNUPLOT replot问题,gnuplot,Gnuplot,我设置了一个多点模式,如下所示: set terminal wxt size 1500,900 set format x "%d%m%y %H:%M:%S" set xdata time set timefmt x "%Y%m%dT%H%M%S" set key font ",6" set lmargin 10 set rmargin 10 set multiplot layout 2,1 plot "output.txt" u 1:2 w lines axes x1y1, \ "output.

我设置了一个多点模式,如下所示:

set terminal wxt size 1500,900
set format x "%d%m%y %H:%M:%S"
set xdata time
set timefmt x "%Y%m%dT%H%M%S"
set key font ",6"
set lmargin 10
set rmargin 10
set multiplot layout 2,1
plot "output.txt" u 1:2 w lines axes x1y1, \
"output.txt" u 1:3 w lines axes x1y2
plot "output.txt" u 1:40 w lines axes x1y1, \
"output.txt" u 1:39 w lines axes x1y2
set y2tics border
unset multiplot
它起作用了,给了我两个图,一个在另一个上面


但是按下“replot”按钮(或使用缩放)会导致第二个绘图填充窗口-完全隐藏第一个绘图。

是的,这就是
replot
的行为方式。文件中说:“请注意,在多点打印模式下,replot只能复制最新的组件图,而不能复制整套。”


因此,您可以将整个
set multiplot…unset multiplot
内容放入一个外部文件中,
load
它,然后再
load
它。或者将该内容放入一个字符串中并
eval
它几次。

我也遇到了同样的问题。通过循环解决了它:

设置术语wxt enh
[IDX=0:1]的do{
如果(IDX==1){
设置终端png增强
设置输出“temp.png”
}
集多点
设置大小1,1
将原点设置为0,0
图sin(x)
设置大小为0.5,0.35
将原点设置为0.13,0.63
图cos(x)
未设置多点
}
设定输出

设置术语wxt enh
这里是另一个解决方法。它不直接回答问题,但可以为其他类似问题提供思路。放入页眉和页脚“重新读取”,然后可以为类似的多点打印选择两个上下文(完成两次)

如果(存在(“排练”))排练=1+排练;设置术语x11
如果(!exists(“prepect”))prepect=0;设置术语png;设置输出sprintf(“test\u palete\u%s.png”,system(“date+\%F\”)

pr“prepect=”.prepect;show term#嗯,这太痛苦了!我正在尝试放大-外部负载不会真的起作用。你是对的,这对你的案例不起作用。但这一功能在不久的将来出现的可能性很小(不要问我时间跨度:)。这与问题无关。它无法解决OP询问的
replot
问题。
if (exists("rehearse")) rehearse=1+rehearse; set term x11
if (!exists("rehearse")) rehearse=0; set term png; set output sprintf("test_palette_%s.png", system("date +\"%F\""))

pr "rehearse=".rehearse; show term #<= comment printing
set samples 100;  set isosample 100,100
set xrange [0:1]; set yrange [0:1]
set palette defined (0 "white", 1 "red")
set autoscale cbfix; unset colorbox; unset key

set multiplot layout 2,2   
plot '++' using 1:2:1 with image
plot '++' using 1:2:2 with image
plot '++' using 1:2:(-$1) with image
plot '++' using 1:2:(-$2) with image
unset multiplot

if(rehearse <  1) reread