Menu

#2086 unexpected behavior between multiplot and pause for X11

None
closed-works-for-me
nobody
None
2020-09-16
2018-11-12
Mike Sutton
No

I came across this oddity. I usually put a pause outside of the end of a multiplot block. However with the 5.x.x I don't get the same behaviour as with 4.6.x. The 5.2 version quickly flashes two plots and then the screen turns to a single at the pause statement. If I insert a pause just inside the 'unset multiplot', then two plots appear as expected. This appears to only affect the X11 terminal. Furthermore, if I comment out all the pause commands and run "gnuplot -persist" I get two plots.

I see some slight differences in the X11_text routine with respect to looping over axes. I believe the 'S' commands relate to axis scaling.

I'm running on CentOs 7.2 and 7.5.

The small script below replicates the problem.

set term x11
png = 0
if (png >0) set term png ; set out 'multiplot_err.png' # works

set grid
unset xtics

set multiplot title "plot xxxx"  layout 2,1 scale 1.0, 0.9
plot x

set title ''
set xtics
plot x lt 2

#pause -1 'inside pause'  # <-- this pauses with 2 plots
unset multiplot

pause -1 'hit'  # <-- this pauses with only one plot on screen.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2018-11-12

    I cannot reproduce this with any of 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 as built here.
    I have testted only with old versions of gnuplot itself, not with the corresponding executables for gnuplot_x11. However "pause -1" does not depend on gnuplot_x11 so that should not matter. [1]
    From your description it sounds as if gnuplot is executing an extra "replot" command, but I do not know why it would be doing that.

    How exactly are you running this script?
    $ gnuplot script.foo
    $ gnuplot
    gnuplot> load 'script.foo'
    $ gnuplot < script.foo
    something else?

    Did you build from source or are you seeing this with an executable provided by CentOs?

    I believe the 'S' commands relate to axis scaling
    ?? I do not understand. What is an 'S' command?

    [1] "pause mouse" is another matter and there have been several rounds of tweaking during 5.2.x development to make "pause mouse close" work reliably.

     
  • Mike Sutton

    Mike Sutton - 2018-11-12

    Here is some more info below. I just tried a completely new build, same problem. I attached the output from 4.6.5 and 5.2.5.

    $ uname -a
    Linux centos7 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    
    $ ./configure --prefix=/home/suttonmw/tmp/ztmp1
    $ make
    $ cd src
    $ pwd
    /home/suttonmw/tmp/gnuplot-5.2.5/src
    $ setenv GNUPLOT_DRIVER_DIR `pwd`
    $ echo $GNUPLOT_DRIVER_DIR
    /home/suttonmw/tmp/gnuplot-5.2.5/src/
    $ ./gnuplot script.foo
    
     

    Last edit: Mike Sutton 2018-11-12
  • Ethan Merritt

    Ethan Merritt - 2018-11-12

    Sorry, I can't help since I can't reproduce that behavior here. Do you see the same problem with the qt or wxt terminal? I ask because "pause -1" should be independent of the current terminal type.

     
  • Shigeharu TAKENO

    I can't also reproduce that behavior by my gnuplot-5.2.5 on Solaris 10 and on FreeBSD 11.
    Well, if you type the command lines instead of the script, do some error messages appear ?

     
  • Mike Sutton

    Mike Sutton - 2018-11-21

    Well after trying many things. Removed all my Xdefauls. I narrowed it down to an interaction with the "noreplotonresize" option. I then tried the Qt terminal. The plot was as expected, but a resize caused the plot to be redrawn as a single plot.

    ./gnuplot -noreplotonresize script.foo
    

    What I don't understand is that I was not resizing the X11 window. Is this the desired behavior? Should anything be added to the multiplot help in the documentation about these types of interactions?

    Just close this out if you don't think anything needs done.
    Thanks again

     
  • Ethan Merritt

    Ethan Merritt - 2018-11-21

    Yes, if you resize the plot and have previously set the "replot on resize" option then that will replace the multiplot with a single copy of the last plot.

    I do not know why your x11 plot window is sending/recieving an extra "replot" command.

     
  • Ethan Merritt

    Ethan Merritt - 2019-05-21
    • status: open --> open-works-for-me
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2020-09-16
    • status: open-works-for-me --> closed-works-for-me
     

Log in to post a comment.

MongoDB Logo MongoDB