使用while循环和qt终端时,gnuplot不会使图形最大化

时间:2015-09-05 22:00:53

标签: qt window gnuplot x11

当我将我的情节封装在while循环中时,图形在最大化窗口中不会保持最大化 - 它只是闪烁一点时间并恢复到其初始大小(小)。它也无法手动最大化(通过图标)。

示例代码:

while (1) {
plot \
  '< cat sysload.host.log | sed "s~| ~~g"' using 2:3 with boxes linetype rgb "green" title "HOST avgl1", \
  '< cat sysload.host.log | sed "s~| ~~g"' using 2:8 with points linetype rgb "green" title "HOST #cpus", \
  '< cat sysload.host.log | sed "s~| ~~g"' using 2:($9*ymax_host/100) with lines linetype rgb "green" title "HOST %RAM used", \
  '< cat sysload.is.log | sed "s~| ~~g"' using 2:3 with impulses linetype rgb "red" title "IS avgl1", \
  '< cat sysload.is.log | sed "s~| ~~g"' using 2:8 with points linetype rgb "red" title "IS #cpus", \
  '< cat sysload.is.log | sed "s~| ~~g"' using 2:($9*ymax_is/100) with lines linetype rgb "red" title "IS %RAM used", \
  '< cat sysload.mail.log | sed "s~| ~~g"' using 2:3 with histeps linetype rgb "blue" title "MAIL - avgl1", \
  '< cat sysload.mail.log | sed "s~| ~~g"' using 2:8 with points linetype rgb "blue" title "MAIL - #cpus", \
  '< cat sysload.mail.log | sed "s~| ~~g"' using 2:($9*ymax_mail/100) with lines linetype rgb "blue" title "MAIL %RAM used"
pause 5 "waiting 5s to redraw..."
#reread
#replot
}

使用“重读”和/或“重新绘制”无济于事。

当我在没有while循环的情况下进行绘图并最大化窗口时,图形也会最大化。

示例代码:

plot \
  '< cat sysload.host.log | sed "s~| ~~g"' using 2:3 with boxes linetype rgb "green" title "HOST avgl1", \
  '< cat sysload.host.log | sed "s~| ~~g"' using 2:8 with points linetype rgb "green" title "HOST #cpus", \
  '< cat sysload.host.log | sed "s~| ~~g"' using 2:($9*ymax_host/100) with lines linetype rgb "green" title "HOST %RAM used", \
  '< cat sysload.is.log | sed "s~| ~~g"' using 2:3 with impulses linetype rgb "red" title "IS avgl1", \
  '< cat sysload.is.log | sed "s~| ~~g"' using 2:8 with points linetype rgb "red" title "IS #cpus", \
  '< cat sysload.is.log | sed "s~| ~~g"' using 2:($9*ymax_is/100) with lines linetype rgb "red" title "IS %RAM used", \
  '< cat sysload.mail.log | sed "s~| ~~g"' using 2:3 with histeps linetype rgb "blue" title "MAIL - avgl1", \
  '< cat sysload.mail.log | sed "s~| ~~g"' using 2:8 with points linetype rgb "blue" title "MAIL - #cpus", \
  '< cat sysload.mail.log | sed "s~| ~~g"' using 2:($9*ymax_mail/100) with lines linetype rgb "blue" title "MAIL %RAM used"
pause -1 "waiting... (hit ENTER)"

有趣的是,当我将终端设置为“x11”时:

set terminal x11 enhanced font "arial,10"

,它保持最大化。没有“set terminal”,它默认为“qt”。

我可以使用这个“修复”,但它不方便,因为x11终端产生更差的输出,字体有别名,有巨大的间距,并且没有正确地呈现变音符号(捷克语“žčšř”等):/

有任何帮助吗?谢谢!

使用Xubuntu 15.04和gnuplot 4.6 patchlevel 6

编辑: 样本输入数据:

$ tail -1 sysload.mail.log 
2015-09-06 00:16:01 | 0.22 0.32 0.29 1/419 7539 | 6 | 76.0 | 531120240

0 个答案:

没有答案