|
From: Daniel J S. <dan...@ie...> - 2006-04-02 18:58:22
|
Chris K wrote: > This is passing strange. I am attaching my files. > > (Endian is correct for Mac OS X on PPC, you may need to specify). OK, "endian=big" works.> I almost see what is happening now. > outd.data is exactly 10 floats long (40 bytes) > > cat test-2.gp outd.data out.data | gnuplot WORKS > cat test-3.gp outd.data out.data | gnuplot WORKS > cat test-4.gp outd.data out.data | gnuplot FAILS > cat test-4.gp outd.data out.data outd.data | gnuplot WORKS If you mean that it plots, then yes "WORKS" is correct. However, I think this isn't working the manner you intend. It's subtle because of the fact the data within the file looks to be a simple linear or affine relationship. Thus, the shape of the curve when gnuplot does or doesn't generate the index data is about the same. Read on... >>This works: >> >>set title "test-2.gp" >>plot "-" binary record=10 using 0:1 with linespoints,\ >> "-" binary record=10 using 0:($1)**2 with linespoints It specifies record of 10 and since "0" is a special qualifier in gnuplot meaning to generate the index data 10x1=10 floats for the first line and 10*1=10 floats for the second line. No problem; a plot with red and green lines each containing 10 points. (I'll send you the PNGs in a separate email.) Note that "0" and "-1" as special column numbers isn't the most intuitive. Ease of programming probably trumped in that case. There may be a bug here however. I notice that with "0" the index starts at "-1" on the plot. That doesn't seem a reasonable place to start. It should be either "0" or "1". I will check the documentation to see if the start value is specified and will fix it accordingly. >> >>This works: >> >>set title "test-3.gp" >>plot "-" binary record=10 using 0:1 with linespoints,\ >> "-" binary record=5x2 using 1:($2)**2 with linespoints Again, there is a "0" on the first line so that is 10x1=10 floats. But now the second line is saying that the record inside the binary file is 5 by 2 or five pairs (or five 2 tuples) and the using syntax says to use the first coordinate of the pair and the second coordinate of that pair. The "record" and "using" do no conflict, but the specification is that there are only 5 points. So if you look at the graphs you should see there are only 5 points for "test-3.png". As I said before, because of the linear nature of the data, you may have seen the two and thought that "test-2" and "test-3" plotted the same but in fact they are different. >> >>This fails, saying "line 0: warning: Skipping data file with no valid points" >> >>set title "test-4.gp" >>plot "-" binary record=5x2 using 1:2 with linespoints,\ >> "-" binary record=5x2 using 1:($2)**2 with linespoints >> >>The use of 5x2 instead of 10 in the first plot triggers the error. I am going >>to hypothesize that the first use of "record=5x2" causes it to read an amount of >>data greater than "record=10". You may be correct. But I don't see why if fails. This could be a strange "loose end" kind of bug (an unaccounted for boundary value or something) because the "record" and "using" make sense on the plot. The data in the file is 0 1 2 3 4 5 6 7 8 9 and both the red and green plots are obviously treating the data as (0,1) (2,3) (4,5) (6,7) (8,9) in "test-4.png". OK, so a couple strange things there, using "0" starting at -1 and a complaint about running out of data when there really shouldn't be. Let me work on this... Dan |