From: Bennett, S. \(GE Infrastructure\) <Sil...@ge...> - 2005-12-23 01:13:26
|
Hi All, I have observed some strange behavior with gnuplot recently. I am = running Gnuplot version 4.0 patchlevel 0 ( packaged in Debian / Etch ). = I will demonstrate the problem I am having with a simplified case: #!/bin/bash { echo 'plot "-" using 1:2 with lines, \' echo '"" using 1:3 with lines' echo '0 1 2' echo '1 2 3' echo '2 3 4' echo '3 4 5' echo '4 5 6' echo '5 6 7' echo 'e' } | gnuplot -persist ### End Bash Script This outputs the following message with no plot:=20 >gnuplot> plot "-" using 1:2 with lines, "" using 1:3 with lines > = ^ > line 7: no data point found in specified file Is this a feature or a bug? ;0) This next script demonstrates that the concept is right in that it = generates the plot that you would expect. #!/bin/bash { echo 'plot "-" using 1:2 with lines' echo '0 1 2' echo '1 2 3' echo '2 3 4' echo '3 4 5' echo '4 5 6' echo '5 6 7' echo 'e' } | gnuplot -persist ### End Bash Script The plot I am asking for in the first script works if I read from a file = instead of stdin: ### This is the contents of testdata.txt ### 0 1 2 1 2 3 2 3 4 3 4 5 4 5 6 5 6 7 ### End of testdata.txt ### #!/bin/bash { echo 'plot "testdata.txt" using 1:2 with lines, \' echo '"" using 1:3 with lines' } | gnuplot -persist ### End Bash Script This script generates the appropriate plot. Looking around on the net to try to find the solution to this problem I = came across this link: http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/t= hread/593fd1647d96eb6b/06b84b965f06e4d7?q=3Dno+data+point+found+in+specif= ied+file&rnum=3D3#06b84b965f06e4d7 using the concept outlined there, the original script could be written = as such: #!/bin/bash { echo 'plot "-" using 1:2 with lines, \' echo '"-" using 1:3 with lines' echo '0 1 2' echo '1 2 3' echo '2 3 4' echo '3 4 5' echo '4 5 6' echo '5 6 7' echo 'e' echo '0 1 2' echo '1 2 3' echo '2 3 4' echo '3 4 5' echo '4 5 6' echo '5 6 7' echo 'e' } | gnuplot -persist ### End Bash Script This works, but presents a bigger problem... Now moving away from the simple case, I need to plot 48 channels of = floating point data from a 125Hz (as much as 4KHz) streaming source. I = need to plot about 1000 data points per channel and have the plot = refresh as quickly as possible. I could store the data in a buffer and re-echo it to gnuplot 48 times = but I take a huge performance hit when I do. Similarly I could rewrite = (overwrite) the data to a file and plot the file, but that kills the = performance as well. Any ( Suggestions / Help / Commiserations / RTFM's followed by a link to = the M ) will be appreciated. Cheers, Silas Bennett =3D0) Silas L Bennett GE Security Scientist / Engineer T 858 605 5500 x 323 F 858 605 5501 sil...@ge... www.gesecurity.com 15175 Innovation Dr. San Diego, CA 92128 USA |
From:
<br...@ph...> - 2005-12-25 13:23:03
|
Bennett, Silas (GE Infrastructure) wrote: >> gnuplot> plot "-" using 1:2 with lines, "" using 1:3 with lines ^ >> line 7: no data point found in specified file > Is this a feature or a bug? A feature. Of your command script as much as of gnuplot The problem is that you're trying to read the same inline data set twice. That's not how inline data work. You would have to split you your multi-column data into separate datasets, with one 'E'nd-of-data per file mentioned in the plot: plot "-" u 1:2, "" u 1:2 1 2 4 5 E 1 3 4 6 E > Now moving away from the simple case, I need to plot 48 channels of > floating point data from a 125Hz (as much as 4KHz) streaming source. That's really not the kind of work gnuplot was ever meant for. It's not a real-time plotting engine, but an interactive program with a scripting language. It's not explicitly made slow, neither is there *any* kind of real-time guarantee. > I could store the data in a buffer and re-echo it to gnuplot 48 times > but I take a huge performance hit when I do. No need to re-echo all of it --- just echoing the actual columns used would be sufficient, i.e. two columns per '' in the command. |
From: Matti P. <ma...@pi...> - 2006-01-26 20:21:39
|
Hans-Bernhard Bröker wrote: > Bennett, Silas (GE Infrastructure) wrote: >>> gnuplot> plot "-" using 1:2 with lines, "" using 1:3 with lines ^ >>> line 7: no data point found in specified file > >> Is this a feature or a bug? > > A feature. Of your command script as much as of gnuplot > > The problem is that you're trying to read the same inline data set > twice. That's not how inline data work. You would have to split you > your multi-column data into separate datasets, with one 'E'nd-of-data > per file mentioned in the plot: > > plot "-" u 1:2, "" u 1:2 > 1 2 > 4 5 > E > 1 3 > 4 6 > E > >> Now moving away from the simple case, I need to plot 48 channels of >> floating point data from a 125Hz (as much as 4KHz) streaming source. > > That's really not the kind of work gnuplot was ever meant for. It's not > a real-time plotting engine, but an interactive program with a scripting > language. It's not explicitly made slow, neither is there *any* kind > of real-time guarantee. > >> I could store the data in a buffer and re-echo it to gnuplot 48 times >> but I take a huge performance hit when I do. > > No need to re-echo all of it --- just echoing the actual columns used > would be sufficient, i.e. two columns per '' in the command. > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > To create a kind of rolling plot (oscilloscope) I fount a neat trick: create a bitmap of the axes, and create a blank bitmap of the data. At each point in time that you wish to add a new data point, add a new column to one side of the data bitmap while cutting one off from the other side, turn on the pixel at the appropriate row for the data, and then create the final image by combining the two bitmaps. A windows/MFC implementation can be found at http://www.codeproject.com/miscctrl/oscope.asp Matti |