GNUPLOT 无法放大

GNUPLOT cannot zoom in

我遇到无法放大 GNUPLOT 的问题。我创建了一个记录各种资源信息的bash脚本,并通过以下命令显示这些信息。

gnuplot -e persist "set title 'Resource monitor' ; set timefmt '%y/%m/%d-%H:%M:%S' ; set xdata time ; set xlabel 'TIME' ; set ylabel 'PERCENT' set yrange [0:101]" -e "plot '${cpuResFile}' using 1:2 title 'CPU' smooth Bezier, '${memResFile}' using 1:2 title 'MEM' smooth Bezier" &

图表是可见的,显示了我想要的信息,我只是不知道如何让它放大和缩小。我读到它与不再设置的 X11 window 有关,或者我需要通过命令行设置它,我只是不知道如何设置,或者这是否是原因。希望有几个 GNUPLOT 专家可以帮助我。 :)

谢谢。

在带有 -persist 标志的交互式 windows 中无法缩放和取消缩放。这些操作将需要重新绘制,这不可能了,因为主程序已经退出。

引自 persist 文档:

[...] gnuplot will open a display window, draw the plot into it, and then exit, leaving the display window containing the plot on the screen. Depending on the terminal type, some mousing operations may still be possible in the persistent window. However operations like zoom/unzoom that require redrawing the plot are generally not possible because the main program has already exited

您可以在命令列表末尾添加pause -1

gnuplot -e "plot sin(x); pause -1" &