|
From: Hans-Bernhard B. <br...@ph...> - 2004-03-04 12:57:09
|
On Wed, 3 Mar 2004, Daniel J Sebald wrote: > > Oh yeah, I forgot about "matrix". The issue there is that "matrix" is > designed for 3d data, i.e., splot. (List members, if anything I say > here is incorrect, please correct me.) I was going to about 'matrix', but you seemed to be progressing so nicely, I though I'ld let you you find that one yourself ;-> > There is a routine in "datafile.c" called df_3dmatrix. I think it only > get's called from "plot3d.c". Don't just think, check it. Tools like "cscope" will let you answer such queries almost in an instant: gnuplot/src> cscope -L0 df_3dmatrix datafile.h <global> 100 int df_3dmatrix __PROTO((struct surface_points *, int )); datafile.c df_3dmatrix 1268 df_3dmatrix(this_plot, need_palette) plot3d.c get_3ddata 652 xdatum = df_3dmatrix(this_plot, NEED_PALETTE(this_plot)); You can even let it show you only the calls to a function: gnuplot/src> cscope -L3 df_3dmatrix plot3d.c get_3ddata 652 xdatum = df_3dmatrix(this_plot, NEED_PALETTE(this_plot)); > not the mode is "splot" or "plot". In other words, if I'm not mistaken, > Gnuplot should not allow "matrix" to be used in "plot" mode. The current official version probably shouldn't, right. So let's try... gnuplot> p 'using.dat' matrix u ($0):2:3 w e No error, no warning, and a rather stupid plot. How's that for a rather surprising undocumented feature? > Actually, in the image patch, I modified things so that a mode variable > is passed into that routine so it is possible to identify whether > "splot" or "plot" was issued. I probably needed that information for > something else, but it could be used to rule out "matrix" when issued > with "plot". But it should only be ruled out if that was not a 'plot with pixels', right? > in previous discussions, that 2d and 3d formats have diverged in some > ways. I suspect they have never started off a common ground in the first place. After looking at all the code for prolonged times, you get the impression 3D must have been grafted onto an existing 2D-only plotting program as an afterthought. > I think the "datafile.c" and related routines could be cleaned up > a great deal, focusing more on just getting data from a file into > Gnuplot and not so much on what the eventually plotting mode will look like. Agreed. After 4.0 is out, we could split datafile.c into two: datafile.c and "using.c". The latter would be in charge of all the translation from data records into gnuplot "points", i.e. treat options 'using', 'every', 'index' and 'smooth' (which really should be renamed to 'filter' some time). > Do developers here agree that, for large files, binary data in "plot" > mode is preferable to ascii matrix? Preferrable: yes. But not so much so that it would be a strong argument against allowing 'matrix' at least in those 2D plots that really are 3D (i.e. "plot with image"). I think we actually should allow 'matrix' for such plots. It's about equally sensible as allowing binary files for 2D plots. But this really had better be delayed until after the 4.0 release. We might want to put this into the "TODO" file, though. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |