From: Alan W. I. <ir...@be...> - 2017-05-28 20:29:52
|
On 2017-05-28 10:35-0000 l1q1d wrote: > --- > > ** [support-requests:#43] Colormap log** > > **Status:** open > **Group:** > **Created:** Sun May 28, 2017 10:35 AM UTC by l1q1d > **Last Updated:** Sun May 28, 2017 10:35 AM UTC > **Owner:** nobody > > > Hi, do you have any idea how to have log color in colormap/plshade/colorbar? I have CC'd my response to your support request to the plplot-general mailing list. Since that is our preferred support mechanism (to collect support requests and the discussion of them all in one place), I ask that you subscribe to that mailing list (see directions at <https://lists.sourceforge.net/lists/listinfo/plplot-general>) and follow up there with your (likely inevitable) supplementary PLplot questions rather than on this deprecated support request tracker. That is an interesting question concerning color map 1 (N.B. not color map 0 since that is for discontinuous colors). The independent variable of cmap1 ranges from 0 to 1 (inclusive). We have no switch to interpret cmap1 values as logs, but that is not necessary since you can do that conversion yourself. For example, suppose you have an array z of 3rd coordinates which you would like to represent as a cmap1 color. Then try this transform: c = log(z/zmax)/log(zmax/zmin) + 1 That c array is proportional to log z as you require, but due to the linear transformation all values of that array are in the correct cmap1 range from 0 to 1 as you can see by substituting z=zmax where c = 1 and z=zmin where c = 0 on the RHS. So use that transformed c array or value anywhere (e.g., plshade, plshades, plcol1, plcolorbar) that a cmap1 color map value can be used, and you should be OK. However, as far as I know nobody has ever tried this so I would appreciate you following up (on the plplot-general mailing list) with your results (whether good or bad) for the benefit of both our developers and ordinary users. 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); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); 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 __________________________ |