I am having an issue where I am unable to zoom in on my GNUPLOT. I created a bash script that records various resource information, and displays this information via the following command.
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" &
The graph is viewable and displays my information I want, I just cannot figure out how to allow it to zoom in and out. I read that it has something to do with the X11 window no longer being set or that I need to set it via the command line, I just cannot figure out exactly how to, or if this is even the reason. Hopefully there are a couple GNUPLOT experts that can assist me. :)
Thank you.
Zooming and unzooming isn't possible in interactive windows which are left open with the -persist
flag. Those operations would require a redrawing which isn't possible anymore since the main programs has already exited.
Quoting from the persist
documentation:
[...] 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
You could add pause -1
at the end of the command list:
gnuplot -e "plot sin(x); pause -1" &
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With