Menu

#2600 term "qt": plot window not interactive when started from script file.

None
closed
nobody
2023-03-27
2023-03-16
No

Running gnuplot 5.4.6 on Windows 10.

Prerequisite: gnuplot has been installed with file associations (i.e., *.gp) configured by the installer. Otherwise, create a file association manually.

Now create a script file containing gnuplot commands:

set term qt
plot sin(x)

and save it to a file named plot.gp. This file should show the gnuplot icon.

Double-click on this file.

The qt plot windows open.

Try to interact with the plot window, e.g., click on the grid icon to toggle grid on and off, zoom using right-mouse, pan using cursor keys, etc.

Observe, that it does not respond. No interactivity is possible.

I think this is a bug.

If I set the terminal to "wxt", I can interact with the plot window.

Discussion

  • Tatsuro MATSUOKA

    set term qt
    plot sin(x)
    

    For me, gnuplot winows shows up for short and closes.

    set term qt
    plot sin(x)
    pause -1
    

    I can interact the plot windows

    I cannot reproduce.

     

    Last edit: Tatsuro MATSUOKA 2023-03-16
    • Ethan Merritt

      Ethan Merritt - 2023-03-16

      Since it is running from a script rather than from the command line, it would be better to use

      set term qt
      plot sin(x)
      pause mouse close
      

      This should leave the window open, and gnuplot running underneath to support zoom/redraw/etx, until you close the plot window

       
      • Daniel Dan K.

        Daniel Dan K. - 2023-03-17

        Thank you very much for your comments.

        I don't know why I see a different behavior than Matsuoka-san regarding gnuplot plot window. That's puzzling.

        However, suggesting to use pause was successful to enable interactivity.

        While pause -1 enables interactivity with the qt plot window, it also opens a small popup-window with the text "paused". That's superfluous and kind of annoying because I have to close it seperately and if I close it before I close the plot window I'll loose interactivity.

        Therefore I'm resorting to pause mouse close to enable interactivity with the qt plot window. Works like a charm.

         
  • Ethan Merritt

    Ethan Merritt - 2023-03-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
    
     Running gnuplot 5.4.6 on Windows 10.
    
    • status: open --> closed
    • Group: -->
    • Priority: -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.