On 2008-03-08 23:48-0500 Hezekiah M. Carty wrote:

> In its current form, plimage automatically scales the plotted colors
> to take advantage of as much dynamic range in the color scale 1 as
> possible - the minimum value in the given image corresponds to a color
> of 0.0 and the maximum value in the image corresponds to a color of
> 1.0.
>
> The attached patch adds two extra parameters to plimage to allow a
> user to set this range on their own.  Image values of valuemin or less
> will now map to color 0.0 and image values of valuemax or greater will
> map to color 1.0.  Values between valuemin and valuemax will similarly
> map to colors between 0.0 and 1.0, in the same way plimage currently
> handles this.
>
> The reason for this change is to allow multiple plots to be made with
> varying data sets, while maintaining directly comparable color scales
> between plots.  The current implementation does not allow this for
> data sets with different value ranges without manually setting at
> least one pixel to a fixed minimum value and another to a fixed
> maximum value in each image.
>
> This patch affects include/plplot.h and src/plimage.c and should apply
> cleanly against the current PLplot Subversion head.  I have not made
> any adjustments to any of the included language bindings as I want to
> find out if this is an acceptable API change, if I should make this in
> to a new function instead.  I think it is a worthwhile adjustment to
> plimage, particularly given that it is an undocumented function,
> except for the code and an example.

The lack of plimage documentation is an oversight.  Thanks for pointing out
that issue.  I would encourage you to submit a patch for
doc/docbook/src/api.xml to add documentation for plimage (and also your
modified version of it, see next).

I think a variation of plimage with a user-specified colour range is worth
having, but to preserve backwards API compatibility you should rename your
modified version to something else and reimplement plimage as a wrapper so
it has the same arguments as now, derives the minimum and maximum of the
colour range, then calls plimagef to do the rest.  I would encourage you to
modify your present patch to that effect.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to