From: Ethan M. <merritt@u.washington.edu> - 2010-02-26 05:44:19
|
On Wednesday 24 February 2010, Shigeharu TAKENO wrote: > shige 02/25 2010 > ---------------- > > I wrote: > | I prepared sample scripts, data, and results. See > | > | http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/mkbin.c > | http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/mkbin.gp > | http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/mkbin1.gif > | http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/mkbin2.gif > > I explane them. mkbin.c make the following binary matrix data: > > 3.0 5.0 6.0 7.0 (<N+1> <y0> <y1> <y2>) > 0.0 1.0 2.0 3.0 ( <x0> <z0,0> <z0,1> <z0,2>) > 0.1 3.0 1.0 4.0 ( <x1> <z1,0> <z1,1> <z1,2>) > 0.2 2.0 2.5 3.0 ( <x2> <z2,0> <z2,1> <z2,2>) > > Gnuplot script mkbin.gp makes images mkbin1.gif and mkbin2.gif > from the data made by mkbin.c. > > Gnuplot.doc says that gnuplot treat it as the following: > > 0.0 5.0 1.0 > 0.0 6.0 2.0 > 0.0 7.0 3.0 > > 0.1 5.0 3.0 > 0.1 6.0 1.0 > 0.1 7.0 4.0 > > 0.2 5.0 2.0 > 0.2 6.0 2.5 > 0.2 7.0 3.0 > > However, images mkbin1.gif and mkbin2.gif show that these are > made from the data > > 5.0 0.0 1.0 > 6.0 0.0 2.0 > 7.0 0.0 3.0 > > 5.0 0.1 3.0 > 6.0 0.1 1.0 > 7.0 0.1 4.0 > > 5.0 0.2 2.0 > 6.0 0.2 2.5 > 7.0 0.2 3.0 I confirm these results, running on linux. Could you please start a new bug tracker entry for this on SourceForge, and upload the mkbin.c and mkbin.gp files to go with it? > Moreover, I found a problem in these tests. The following script > > ! ./mkbin > mkbin.dat > splot "mkbin.dat" binary matrix with lines > > works. But, > > splot "< ./mkbin" binary matrix with lines > > does not work and gnuplot says "line 1: Data file is empty". The binary file routines use fseek(), which will not work on piped input. I do not know if the code can be re-written so as to not use fseek(). And yes, I can see from the input code in datafile.c routine df_determine_matrix_info() that it reads x across the top and y down the left column. So the code disagrees with the documentation. To me the layout described by the documentation is more natural, but that is not what the code implements. Work-around: splot "mkbin.dat" binary matrix using 2:1:3 with lines I expected the "transpose" keyword to work also, but apparently it is broken. Sigh. Any volunteers to re-write the binary file code? If not, should we re-write the documentation? |