0

when I enclose my plots in while loop, the graph does not stay maximized in a maximized window - it just blinks a little moment and reverts to its initial size (small). It cannot be maximized manually either (via the icon).

Sample code:

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
}

Using "reread" and/or "replot" does not help.

When I plot without the while loop and maximize the window, the graph gets maximized, too.

sample code:

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)"

Interresting is that when I set terminal to "x11":

set terminal x11 enhanced font "arial,10"

, it stays maximized. Without "set terminal" it defaults itself to "qt".

I could use this "fix", but it is not convenient, because the x11 terminal produces worse output, fonts are aliased, have huge spacing and do not render diacritics (czech "žčšř" etc.) correctly :/

Any help? Thanks!

Using Xubuntu 15.04 with gnuplot 4.6 patchlevel 6

EDIT: sample input data:

$ tail -1 sysload.mail.log 
2015-09-06 00:16:01 | 0.22 0.32 0.29 1/419 7539 | 6 | 76.0 | 531120240
crysman
  • 167
  • 1
  • 11
  • Try the `wxt `terminal. – Christoph Sep 06 '15 at 07:43
  • It's not a known terminal type: `set term wxt ^ "./sysload.gp", line 40: unknown or ambiguous terminal type; type just 'set terminal' for a list` – crysman Sep 06 '15 at 09:14
  • Then it is not available on your system. So you can either try to get the `wxt` terminal (via other gnuplot packages), or version 5 which has a heavily reworked `qt` terminal. I think you have no other options. – Christoph Sep 06 '15 at 09:24
  • I tried here with 4.6.6 and have no problems (using a self-compiled gnuplot). What about a very short script like `do for [i=1:10] { plot x**i; pause 2}`. Can you reproduce the error with this? – Christoph Sep 06 '15 at 11:46
  • Yes, same thing with this little script. Interresting for debugging might be the fact that after the last graph (when the loop ends), the picture is redrawn maximized in the window. **During the loop it stays small**, though :/ I have thought it might be because of the 2 monitor setup I use, but the problem prevails even with one monitor only. – crysman Sep 06 '15 at 13:27
  • Try opening the plot window with `clear`, maximize it and then run your script. – Christoph Sep 06 '15 at 14:17
  • The "clear" hack works only in interactive mode (that is running "gnuplot" and using its console). When running it via script (test.gp), it does not work :/ `$ cat /tmp/test.gp #!/usr/bin/gnuplot clear do for [i=1:10] { clear; plot x**i; pause 2}` – crysman Sep 07 '15 at 09:42
  • See http://stackoverflow.com/a/25410749/2604213 for a way to extract the monitor size and use it as window size for gnuplot – Christoph Sep 07 '15 at 17:13
  • That seems to fix my problem... Thank you! I have to substract some window borders and headers, but it's ok. Thanks for opening me the world of system() and "macros" :) So far I am using simple `set terminal qt size 1300,650` which works. – crysman Sep 08 '15 at 07:17

0 Answers0