From: Petr M. <mi...@ph...> - 2006-05-10 08:53:56
|
> I'm sending a sample .ps file with gradient fill for the default palette. > > I calculated the values at 11 equally spaced points and converted them > > I don't know enough about PostScript language to be able to tell how > /data can be calculated in the PostScript file itself, but I'm almost > sure that it is possible. In any case gnuplot can calculate those 11 > (or more) values if needed. Please how a look into scripts pm3dCompress.awk and pm3dConvertToImage.awk how the online calculation of colors using RGB formulae can be done. BTW, do you know these scripts? They were written ages ago exactly for the purpose of making the ps files smaller. > I need my own version of drawing "smooth_box" (the terminal supports > vector graphic format, so drawing a whole lot of rectangles of single > color is extremely inefficient). Well, if you need it *now*, just write an awk/sed script which replaces it in-place. > Sure, but that doesn;t mean that it couldn't be rendered more > efficiently. Then this would require that gnuplot looks at the data *before* drawing them, tests pixel coordinates whether they form an equidistant grid (matrix), and if yes, then call the image() routine instead of the pm3d drawing routine. A similar test was there for the purpose of "with image", but it was removed (you could not set the tolerance). > (One would loose the ability to manualy change the > palette in the PostScript file afterwards (since gnuplot should > calculate the colors before drawing an image as opposed to the current > situation where PostScript calculates the proper color) no, see above >> Thus you mean to automagically change "with pm3d" into "with image" without >> knowing it to user? That's not a good idea I think. > > The user shouldn't notice any difference. But how *exactly* gnuplot makes the switch? See may comments on tolerance above. > OK. Let me try to explain, For drawing the "plotting area" in this > image (http://gnuplot.sourceforge.net/demo_4.1/pm3d.8.png), which is > nothing else but a bitmap image, gnuplot calls my terminal > term->set_color(...) > term->fillbox(...) > 49 x 49 times. For bitmap teminal this doesn't really matter, but for > my terminal it means constructing 49x49 paths and fill each one of > them separately (bot at compile time of the image and when displaying > it in GhostView or Acrobat), not to mention aliasing-artefacts (I > don't know how they are called, but GhostView shows white stripes all > over the plot). This is extremely inefficient. It would be much better > if gnuplot would call a routine > term->image(49,49, ....) > The result would be the visually the same (only better since no I think this is user's error: he should use "with image" and not "with pm3d" if he wants to draw a matrix instead of individual rectangles. Given the documentation for both styles (see gnuplot's help), they operate exactly as designed and documented. Of course an improved performance is nice, but that's why "with image" has been implemented. Thus, now there is the only question how to write the smallest code to draw the colour box with as short code as possible for any value of maxcolors. --- PM |