Menu

#505 Multiplot: replot all feature

None
closed-out-of-date
nobody
None
5
2023-12-30
2020-07-02
No

Hey!

I wonder if it would be possible to add a feature for using multiplot to allow to replot all previously defined plots, e.g.:

set multiplot layout 2,1
plot x
plot 2*x
unset multiplot
replot {all}

Currently, replot causes to replot only the last plot.
Maybe its not as intended, but I generally use two terminals, e.g. wxt to see my plot interactively and then automatically a script is loaded which sets the terminal to pngcairo to print a file using replot . However this doesn't work with multiplot.
Working around I could write my multiplot command within a loop and change the terminal with the second iteration, but I'm not sure if that is a very elegant solution.

Thanks for your help and suggestions,
Alex

Discussion

  • Ethan Merritt

    Ethan Merritt - 2020-07-02

    Not possible in the form you show.
    Although the example you show involves only 'plot' commands, it is common for many changes to the current style, axis ranges, colors, objects, etc, to occur between the multiplot component plots. Thus it is not possible to recreate the multiplot without maintaining, rewinding, and replaying the history for the session. The closest I can imagine would be

    # start saving a copy of all commands to a file
    set snapshot "snapshot.gp"
    set multiplot
    .... lots of multiplot commands
    unset multiplot
    unset snapshot
    # replay previous multiplot
    load "snapshot.gp"
    
     

    Last edit: Ethan Merritt 2020-07-02
  • Alexander Stangl

    Thanks Ethan for your answer.
    I have troubles reproducing your example, as set snapshot is not documented. I found, that using the x11 terminal it should be possible to perform a similar task, however, it is not available on my machine/gnuplot version. Is there another terminal which can perform such task?
    I tried something similar using the history command, but wasn't successful.

     
    • Ethan Merritt

      Ethan Merritt - 2020-07-07

      You misunderstand. There is no such thing as 'set snapshot' now. I was imagining what might be the closest thing to what you request that would be possible.

       
      👍
      1
  • Mathias Zechmeister

    Qt and wxt windows have already a button for export to and copy to clipboard.
    It would be nice, when snapshot would do the same from command line/script.

     
  • Ethan Merritt

    Ethan Merritt - 2023-12-30

    Version 6 now supports a "remultiplot" command, and tries to use this automatically if appropriate when a "replot" is issued. I imagine there is still room for a lot of improvement, but it does work.

     
  • Ethan Merritt

    Ethan Merritt - 2023-12-30
    • status: open --> closed-out-of-date
    • Group: -->
     

Log in to post a comment.