|
From: Dima K. <gn...@di...> - 2025-12-03 17:02:05
Attachments:
tst.gp
|
Hello.
I just ran the gnuplotlib unit test, and I see lots of warnings with one
of the tests. The plots are still made, but there's A LOT of console
chatter now:
"/tmp/tst.gp" line 17: warning: Reading from '-' inside a multiplot not supported; use a datablock instead
"/tmp/tst.gp" line 18: warning: Reading from '-' inside a multiplot not supported; use a datablock instead
"/tmp/tst.gp" line 19: warning: Reading from '-' inside a multiplot not supported; use a datablock instead
"/tmp/tst.gp" line 20: warning: Reading from '-' inside a multiplot not supported; use a datablock instead
"/tmp/tst.gp" line 21: warning: Reading from '-' inside a multiplot not supported; use a datablock instead
This keeps repeating many times. Cut-down python script:
import numpy as np
import gnuplotlib as gp
xx,yy = np.meshgrid(np.linspace(-5,5,20),
np.linspace(-5,5,20))
zz0 = np.sin(xx) + yy*yy/8.
gp.plot3d( (zz0,
dict(_set = ( 'origin 0,0',
'size 1,1',
'view 60,20,1,1',
'xrange [0:20]',
'yrange [0:20]',
'zrange [0:10]',
'contour base',
'xyplane at 10',))),
tuplesize=3,
_with = 'lines nosurface',
square=1,
wait=True,
hardcopy='/tmp/tst.gp',
ascii=True,
multiplot=True)
The resulting gnuplot script is attached. It clearly shows the warnings.
What isn't supported here? I've been doing this for years with great
success, and it appears to still work today. Should I be doing something
different? I use gnuplot constantly, every day. But 99% of my usage is
either through feedgnuplot or gnuplotlib, both of which use inline data.
Should those tools be using a datablock? Can they?
Thanks.
|
|
From: Ethan A M. <me...@uw...> - 2025-12-03 22:53:45
|
On Wed, Dec 3, 2025 at 9:02 AM Dima Kogan <gn...@di...> wrote: > > I just ran the gnuplotlib unit test, and I see lots of warnings with one > of the tests. The plots are still made, but there's A LOT of console > chatter now: > > "/tmp/tst.gp" line 17: warning: Reading from '-' inside a multiplot not > supported; use a datablock instead > "/tmp/tst.gp" line 18: warning: Reading from '-' inside a multiplot not > supported; use a datablock instead > "/tmp/tst.gp" line 19: warning: Reading from '-' inside a multiplot not > supported; use a datablock instead > "/tmp/tst.gp" line 20: warning: Reading from '-' inside a multiplot not > supported; use a datablock instead > "/tmp/tst.gp" line 21: warning: Reading from '-' inside a multiplot not > supported; use a datablock instead > > This keeps repeating many times. The resulting gnuplot script is attached. It clearly shows the warnings. > > What isn't supported here? Exactly what it says. The current (since version 6.0) implementation of multiplot does not support placing inline data inside a multiplot block. This is because the full set of commands inside `set multiplot .... unset multiplot` is saved for replay during mousing or by a replot command, and inline data would mess that up badly. > I've been doing this for years with great > success, and it appears to still work today. It does not work today. What you see is the first execution, with a warning, while it is reading in the multiplot block. But it does not become part of the multiplot and the program fails to exit the block cleanly. > Should I be doing something different? Yes. $DATA << EOD line 1 line 2 ... line N EOD set multiplot plot $DATA with lp unset multiplot I use gnuplot constantly, every day. But 99% of my usage is > either through feedgnuplot or gnuplotlib, both of which use inline data. > Should those tools be using a datablock? Can they? > For use with gnuplot version 6 they should. The output script, as attached, was also incorrect in that it did not contain an "unset multiplot" command. For that matter, I don't think the script should be using multiplot at all. Why is it using multiplot? There was nothing in the input you showed that requested multiplot. If "set multiplot" appears in the output gnuplot script I think that must be a bug in the program that generated the script. Ethan |
|
From: Dima K. <gn...@di...> - 2025-12-04 08:12:21
|
Thanks for the notes! I'll try to make this change when I get the time. What would work better if I use the datablock? Does that work with older gnuplot also? > The output script, as attached, was also incorrect in that it did not > contain an "unset multiplot" command. OK. It was never clear to me if that was required, and what, if anything, was broken by omitting it. > For that matter, I don't think the script should be using multiplot at > all. Why is it using multiplot? There was nothing in the input you > showed that requested multiplot. I cut down the demo script, which ended up removing the actual "multiplot" part of this. The full script and plot are on the gnuplotlib demo page (towards the end): https://github.com/dkogan/gnuplotlib/blob/master/guide/guide.org Thanks. |
|
From: Ethan A M. <me...@uw...> - 2025-12-05 00:18:36
|
On Thursday, 4 December 2025 00:12:07 PST Dima Kogan wrote: > Thanks for the notes! > > I'll try to make this change when I get the time. What would work better > if I use the datablock? Well, multiplot would work :-) Seiously, your script works fine either with input from '-' or from a datablock so long as it isn't inside a multiplot. > Does that work with older gnuplot also? It works in version 5. (5.0 5.2 5.4) > > The output script, as attached, was also incorrect in that it did not > > contain an "unset multiplot" command. > > OK. It was never clear to me if that was required, and what, if > anything, was broken by omitting it. The multiplot is not fully defined until the "unset multiplot" is reached. One major thing is that most multiplots change the plot boundaries and screen layout. The original boundaries are restored by "unset multiplot". Another is that in version 6, when the program sees a "set multiplot" command it begins saving commands into a datablock of strings named $GPVAL_LAST_MULTIPLOT. It continues saving commands into that block until the "unset multiplot" command is reached. That allows the entire multiplot to be reproduced by replaying the saved commands. That in turn allows "replot" to work, and to some extent mousing/zoom/pan, none of which was possible at all prior to version 6. This is the change that rules out supporting use of plot '-' inside a multiplot, since the data cannot be parsed or executed as valid gnuplot commands. [aside] According to the documentation another concern is that some terminals do not produce any visible output until the "unset" command. I don't think that is true for any current terminals, so that particular warning may be out of date. > > > For that matter, I don't think the script should be using multiplot at > > all. Why is it using multiplot? There was nothing in the input you > > showed that requested multiplot. > > I cut down the demo script, which ended up removing the actual > "multiplot" part of this. The full script and plot are on the gnuplotlib > demo page (towards the end): Ah. And there is the polar mode plot you filed a bug report for. - Ethan |
|
From: Dima K. <gn...@di...> - 2025-12-10 07:01:24
|
Good info. Thanks for writing that up! Hopefully I'll get some time to fix this on my end soon. |