Ubuntu - gnuplot重新读取取消选择的文本



我正在运行一个模拟-一个流体动力学问题-在我的ubuntu分区上,当我运行它时,我希望能够看到它是如何进展的,所以我有脚本来使用gnuplot绘制数据。这些看起来像这样-

set term x11 1 noraise
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log.simpleFoam | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,
"< cat log.simpleFoam | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,
"< cat log.simpleFoam | grep 'Solving for epsilon' | cut -d' ' -f9 | tr -d ','" title 'epsilon' with lines,
"< cat log.simpleFoam | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,
"< cat log.simpleFoam | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
reread

第一行是一个修复我发现停止x11绘图窗口强迫自己到前面每次图形被重新绘制,但我仍然有一个问题,这使我的生活困难:每次重新读取任何文本,我在任何应用程序中选择是自动取消选择,这使得运行这些非常困难,因为我想在其他事情上工作,而他们运行。

有人知道为什么会发生这种情况吗?或者有一个解决方案?

您可以使用不同的终端(pdf, eps等)并保持输出打开,它会自动刷新。当我以前在Ubuntu中工作时,这对我很有效。

set term pdfcairo
set output 'dynamics.pdf'
...

至于为什么会发生这种情况:我的想法是,如果你运行的是一个非常新的Ubuntu版本,X可能与Mir玩得不好。否则我就不太清楚了;

我也遇到了这个问题,最终发现"wxt"终端的工作方式几乎相同,但没有这个问题。

下面是我最终使用的脚本示例:

set term wxt noraise
while (1) {
    # perform the plot here...
    pause 1
}

最新更新