Many gnuplot graphs are not interactive

I draw several graphs through a shell script in gnuplot. Charts are drawn correctly, but I canโ€™t zoom in. Do I need to set any variable? Here is the code:

--- for loop of script starts--- gnuplot -persist <<EOF set term x11 1 set title "IP : $ip Upstream capacity:$UP_CAP kbps" plot 'trace-0-dir1.txt' using (\$1-$min1):(\$2-\$1-$mindelay1) with lp set term x11 2 set title "IP: $ip Downstream capacity:$DOWN_CAP kbps" plot 'trace-0-dir2.txt' using (\$1-$min2):(\$2-\$1-$mindelay2) with lp EOF ---for loop ends--- 
+2
gnuplot
source share
2 answers

As soon as you disconnect from the "x11 1" window, scaling is disabled. To regain control, you must return to the specific window ( set term x11 1 ). Another problem is the x11 terminal. You should use wxt, which can keep windows alive.

You can solve your problem using the wxt terminal and separate the two plot commands, so do not disconnect from the window:

 --- for loop of script starts--- gnuplot -persist <<EOF set term wxt set title "first" plot x EOF gnuplot -persist <<EOF set term wxt set title "second" plot x**2 EOF ---for loop ends--- 

In doing so, you have two scalable windows, and you can still use shell variables.

In general, you should not have the console open in order to have active windows, only the corresponding terminal. In particular, the team

 gnuplot --persist -e 'plot[0:10] sqrt(x)' 

Creates scrollable and scalable windows if used with wxt. Try

 gnuplot --persist -e 'set term wxt; plot[0:10] sqrt(x)' 

Hope this helps.

+3
source share

AFAIK, you can scale, scroll, etc., if the gnuplot console is still active. The gnuplot value should still work.

To scale and scroll, enter the following sequence:

  • Enter the gnuplot console by typing gnuplot
  • build a function with plot[0:10] sqrt(x) , for example.
  • Try zooming (Ctrl + mouse wheel) and scrolling (mouse wheel / Shift + mouse wheel) to , leaving the gnuplot console.

If you run the script as

 gnuplot --persist -e 'plot[0:10] sqrt(x)' 

You can no longer scroll or zoom.

+1
source share

All Articles