Hello,
firstly, I am working with macOS 10.15.4, gnuplot version 5.2.8 and I am using the qt terminal.
I am animating my data by looping over a multiplot
command. by doing so I can see white flashes in the output on the screen. I think the reason for this is that whenever I call set multiplot
in the loop, the entire page gets cleared and then each plot gets redrawn separately when a plot
command is issued.
under help multiplot
i found the following hint:
'For some terminals, no plot is displayed until the command
unset multiplot
is given, which causes the entire page to be drawn and then returns gnuplot
to its normal single-plot mode. For other terminals, each separateplot
command produces an updated display.'
i have tested this on my system and I found out that the qt terminal does redraw on eachplot
command.
to get rid of those flashes, I wanted to ask if it is possible to force redrawing of the entire page only when unset mutiplot
is issued in the qt terminal?
if this is not possible, is there another interactive terminal that comes with this behavior?
PS: I can get rid of the flashes if I plot separate graphs in separate terminals. however, sometimes i would like to plot everything in the same terminal, so that is why i use multiplot.
thanks for your answers.
Not sure I understand what you want, but possibly the key is to never issue the
unset multiplot
command. Consider the following set of commands:This will replace all four plots in the 2x2 layout every 4 seconds, looping forever. The individual plots are drawn sequentially to quadrants A B C D A B C D A... within the layout, each time replacing whatever was in that quadrant previously.
It gets messier if you want to re-draw the tics each time to match a new range, since they are outside the plot area that gets cleared. If the ranges are constant this is not a problem.
Last edit: Ethan Merritt 2020-06-07
Hello Ethan,
thank your for your reply. I tested your approach and it works for me.
Out of curiousity: Could you please expand on how to re-draw the tics?
Thank you for your help.
Last edit: Florian 2020-06-07
The "layout" option to multiplot is a convenience that frees you from having to manually set the origin and size of each subplot. But it doesn't do things in the right order to support what you want to do. If you want to clear the whole of each subplot separately, you would have to back off to the full multiplot procedure. Something like
Thank you. I have tried using the
clear
command before, but I encountered the problem that not all subplots are cleared with this command.E.g. using your code as a template and running
on my machine produces the plot I have attached here. You can see that the two subplots on the top are not cleared at all.
This over-drawing also happens if I use the
multiplot layout
(together withset multiplot next/prev
to chose the right plot to clear).Am I missing something here?
Hmm. Yeah, I see that there is something weird with the clear command on the qt terminal. It works for output to wxt or x11. I will look into it.
So I guess we have to replace the "clear" command with a manually positioned backing rectangle. I used a colored one so I could confirm what is happening.
Here's a modified loop:
I could not test with wxt and x11 yet (I have to reinstall gnuplot with those terminals enabled).
But I tested your second approach (with manually positioned rectangles in the background) and it works on my machine.
Thanks for all your help!
Since the failure on qt is "clearly" a bug (heh), move this issue to the bug tracker