|
From: yves2010 <su...@vi...> - 2010-08-06 15:44:48
|
Hi I am successfully using Gnuplot as a rendering engine in my application, to display cross-sections of data images, using Windows piping and the special '-' filename to plot inline data. However, I have to convert my data to ASCII and Gnuplot has to convert from ASCII, which takes sufficient time to slow down the reactivity of the cross-section plotting when the user moves the mouse over the image. Could it be possible to have en extension of the syntax, something like plot '-' binary size=<#bytes> so that #bytes bytes of binary data can be sent inline? Thanks in advance Yves -- View this message in context: http://old.nabble.com/Inline-binary-data%3A-new-feature---tp29356460p29356460.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Petr M. <mi...@ph...> - 2010-08-06 21:33:36
|
> I am successfully using Gnuplot as a rendering engine in my application, to > display cross-sections of data images, using Windows piping and the special > '-' filename to plot inline data. However, I have to convert my data to > ASCII and Gnuplot has to convert from ASCII, which takes sufficient time to > slow down the reactivity of the cross-section plotting when the user moves > the mouse over the image. > > Could it be possible to have en extension of the syntax, something like > > plot '-' binary size=<#bytes> > > so that #bytes bytes of binary data can be sent inline? Binary data are allowed for both plot and splot, see: help binary help binary general help binary examples --- PM |
|
From: Daniel J S. <dan...@ie...> - 2010-08-07 05:12:17
|
Yves, That feature may already exist. Look very closely at the demos for images http://gnuplot.sourceforge.net/demo_cvs/image2.html for the example titled "Binary data specified at the command line, intended for use through pipe" (Look for the file in the CVS build if the binary characters don't come through properly). Maybe that will work for you. Dan yves2010 wrote: > Hi > > I am successfully using Gnuplot as a rendering engine in my application, to > display cross-sections of data images, using Windows piping and the special > '-' filename to plot inline data. However, I have to convert my data to > ASCII and Gnuplot has to convert from ASCII, which takes sufficient time to > slow down the reactivity of the cross-section plotting when the user moves > the mouse over the image. > > Could it be possible to have en extension of the syntax, something like > > plot '-' binary size=<#bytes> > > so that #bytes bytes of binary data can be sent inline? > > Thanks in advance > > Yves -- Dan Sebald email: daniel(DOT)sebald(AT)ieee(DOT)org URL: http://www(DOT)dansebald(DOT)com |
|
From: Ethan M. <merritt@u.washington.edu> - 2010-08-07 21:29:40
|
Could this be related to Bug #3041233 "plot '-' with binary : gnuplot for windows"? https://sourceforge.net/tracker/?func=detail&aid=2981027&group_id=2055&atid=102055 On Friday 06 August 2010, Daniel J Sebald wrote: > Yves, > > That feature may already exist. Look very closely at the demos for images > > http://gnuplot.sourceforge.net/demo_cvs/image2.html > > for the example titled > > "Binary data specified at the command line, intended for use through pipe" > > (Look for the file in the CVS build if the binary characters don't come through properly). > > Maybe that will work for you. > > Dan > > > yves2010 wrote: > > Hi > > > > I am successfully using Gnuplot as a rendering engine in my application, to > > display cross-sections of data images, using Windows piping and the special > > '-' filename to plot inline data. However, I have to convert my data to > > ASCII and Gnuplot has to convert from ASCII, which takes sufficient time to > > slow down the reactivity of the cross-section plotting when the user moves > > the mouse over the image. > > > > Could it be possible to have en extension of the syntax, something like > > > > plot '-' binary size=<#bytes> > > > > so that #bytes bytes of binary data can be sent inline? > > > > Thanks in advance > > > > Yves > > > |
|
From: Daniel J S. <dan...@ie...> - 2010-08-08 03:24:24
|
Ethan Merritt wrote: > Could this be related to Bug #3041233 "plot '-' with binary : gnuplot for windows"? > > https://sourceforge.net/tracker/?func=detail&aid=2981027&group_id=2055&atid=102055 Sounds very similar. However, I'm not able to build anything on a Windows machine. Petr's observation suggests that when the size of the data is specified (%float64) it all works, but when the default size is used the data isn't correct. Could it be that Windows handles the default integer size differently than on other systems (i.e., the sizeof() macro works slightly different)? Just a guess. Dan > > On Friday 06 August 2010, Daniel J Sebald wrote: > >>Yves, >> >>That feature may already exist. Look very closely at the demos for images >> >>http://gnuplot.sourceforge.net/demo_cvs/image2.html >> >>for the example titled >> >>"Binary data specified at the command line, intended for use through pipe" >> >>(Look for the file in the CVS build if the binary characters don't come through properly). >> >>Maybe that will work for you. >> >>Dan >> >> >>yves2010 wrote: >> >>>Hi >>> >>>I am successfully using Gnuplot as a rendering engine in my application, to >>>display cross-sections of data images, using Windows piping and the special >>>'-' filename to plot inline data. However, I have to convert my data to >>>ASCII and Gnuplot has to convert from ASCII, which takes sufficient time to >>>slow down the reactivity of the cross-section plotting when the user moves >>>the mouse over the image. >>> >>>Could it be possible to have en extension of the syntax, something like >>> >>>plot '-' binary size=<#bytes> >>> >>>so that #bytes bytes of binary data can be sent inline? >>> >>>Thanks in advance >>> >>>Yves >> >> >> > > -- Dan Sebald email: daniel(DOT)sebald(AT)ieee(DOT)org URL: http://www(DOT)dansebald(DOT)com |
|
From: yves2010 <su...@vi...> - 2010-08-07 13:10:40
|
Thank you for the answer; I had already poked around this.
I am still struggling with the syntax to have Gnuplot accept data organized
in two numbers per line:
<bof>
x1 y1
x2 y2
x3 y3
etc.
<eof>
The command:
plot '-' binary endian=little array=(<#lines>,2) format='%float64'
will make Gnuplot issue: "this 2D plot style cannot handle matrix data"
The command
plot '-' binary endian=little array=<#lines> format='%float64'
plots something, but not enough data are read. The command
plot '-' binary endian=little array=<#lines*2> format='%float64'
plots everything, but do not take into account that is is a sequence of
(xi,yi) datapoints.
Any suggestion?
Yves
Daniel J Sebald wrote:
>
> Yves,
>
> That feature may already exist. Look very closely at the demos for images
>
> http://gnuplot.sourceforge.net/demo_cvs/image2.html
>
> for the example titled
>
> "Binary data specified at the command line, intended for use through pipe"
>
> (Look for the file in the CVS build if the binary characters don't come
> through properly).
>
> Maybe that will work for you.
>
> Dan
>
>
>
>
--
View this message in context: http://old.nabble.com/Inline-binary-data%3A-new-feature---tp29356460p29374469.html
Sent from the Gnuplot - Dev mailing list archive at Nabble.com.
|
|
From: yves2010 <su...@vi...> - 2010-08-08 07:27:15
|
Ethan Merritt wrote: > > Could this be related to Bug #3041233 "plot '-' with binary : gnuplot for > windows"? > > > https://sourceforge.net/tracker/?func=detail&aid=2981027&group_id=2055&atid=102055 > > > > I don't see very much relationship. My problem is rather a syntax misuse. In other words, how can I make gnuplot understand that the inline data is x1 y1 x2 y2.... and not Y1 y2 y3 y4 (BTW, using format='%float64%float64' plots x1 x2 x3... as it probably should) -- View this message in context: http://old.nabble.com/Inline-binary-data%3A-new-feature---tp29356460p29378713.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: yves2010 <su...@vi...> - 2010-08-08 07:53:32
|
Solved! Proper syntax is plot '-' binary record=<#lines> format='%float64' (not "array="). <#Lines> is half the number of inline floats: (xi,yi) per line. Don't ask me why this works... It is not really clear from the doc. Unfortunately, all this for not much! The execution speed is almost the same as with ASCII transmission, and almost the same for 20 or 2048 points. On my computer, an incompressible 100 ms to plot a graph. Yves -- View this message in context: http://old.nabble.com/Inline-binary-data%3A-new-feature---tp29356460p29378768.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Daniel J S. <dan...@ie...> - 2010-08-08 18:34:08
|
The thinking was that a "record" contains the whole tuple (the x, the y, etc) but an "array" has the coordinate inherent and only the ordinate given, i.e., the index determines the x and y. As for speed, these things probably vary from system to system. You could investigate a little further by also comparing ASCII/binary data from a file rather than through a pipe. Perhaps it is the pipe that is slow and is limiting performance regardless of whether it is ASCII or binary. I'd be interested in knowing what you find. Dan yves2010 wrote: > Solved! > > Proper syntax is > > plot '-' binary record=<#lines> format='%float64' > > (not "array="). <#Lines> is half the number of inline floats: (xi,yi) per > line. > > Don't ask me why this works... It is not really clear from the doc. > > Unfortunately, all this for not much! The execution speed is almost the same > as with ASCII transmission, and almost the same for 20 or 2048 points. On my > computer, an incompressible 100 ms to plot a graph. > > Yves > -- Dan Sebald email: daniel(DOT)sebald(AT)ieee(DOT)org URL: http://www(DOT)dansebald(DOT)com |
|
From: sfeam (E. Merritt) <eam...@gm...> - 2010-08-08 19:05:07
|
On Sunday 08 August 2010, yves2010 wrote: > > Solved! > > Proper syntax is > > plot '-' binary record=<#lines> format='%float64' > > (not "array="). <#Lines> is half the number of inline floats: (xi,yi) per > line. > > Don't ask me why this works... It is not really clear from the doc. > > Unfortunately, all this for not much! The execution speed is almost the same > as with ASCII transmission, and almost the same for 20 or 2048 points. On my > computer, an incompressible 100 ms to plot a graph. I had not realized that the primary issue was speed. But 2048 points is a small number. I doubt that playing with the input format for such a small number of points will gain you anything. If your plot actually does become limited by the data input stage, then the option "set datafile nofpe_trap" can gain up to a factor of 2x-4x in speed, at the cost of losing clean error handling if the input is bad. But this isn't likely to be noticeable until the number of points is orders of magnitude larger than your case. Why don't you pin down the execution speed independent of the data input stage first? You could start by timing "set samples 2048; plot sin(x)" |