From: Daniel J S. <dan...@ie...> - 2004-08-19 18:47:58
|
In attempting to make both plot3d.c use only df_readline(), even for matrix data, I think I've uncovered a bug, or perhaps more than one. One of the plots following a use of PM3D with four user specs was failing. Here is some code to illustrate the problem. Launch gnuplot and type splot 'binary2' binary u 1:2:3:($2+($1+$2)/10) w pm3d splot sin(x) w l The first plot shows a blank 3d plot because the palette isn't set. However, the second plot should still work fine because it doesn't require the palette. But it fails because inside of plot3d.c is a test #ifdef PM3D if (df_no_use_specs==4 && !(this_plot->lp_properties.use_palette || pm3d.where[0] || this_plot->pm3d_where[0] || this_plot->plot_style & PM3DSURFACE)) int_error(c_token, "`using` with 4 parameters but surface without `pm3d` or `palette`"); #endif Notice that the first test is whether dn_no_use_specs==4, which it does. The use specs were set by the 'binary2' command to be 4 inside df_open(). However, for the second plot, df_no_use_specs is still equal to 4 because df_open() was not called because a file is not being plotted in the second example. [This is an argument for not using global variables in such a way... but I'll not press that issue.] OK. I think there are multiple bugs there because try the following: set pm3d at s explicit solid splot 'binary2' binary u 1:2:3:($2+($1+$2)/10) w pm3d splot sin(x) w l In this case the second plot works. The above test fails because this_plot->lp_properties.use_palette is TRUE. But notice, the second plot is a line plot. There shouldn't be a color box for such a plot. These problems aren't connected to "binary". Any file read with 4 user specs would cause the same problems. If someone else wants to tackle that one, fine. I'm just going to fix it in the "image/binary" stuff so that it works for a single "df_readline()". I should be done with this patch today some time. It looks like I'm headed in the direction of weeding out the "df_3dmatrix()" routine and instead just using the df_readline() routine [which internally uses df_readascii() or df_readbinary()]. That then would be consistent usage throughout, and as far as I'd like to take the binary stuff. I'll let people know when the patch is ready. Dan |