From: Alan W. I. <ir...@be...> - 2004-12-05 06:24:58
|
On 2004-12-04 22:37-0700 Curtis Cooper wrote: > I think the PLplot colormap setting functions expect color ranges clamped > between [0,1]. > > Cheers, > Curtis > On Sat, 4 Dec 2004, Tune Kamae wrote: > >> Dear PLplot experts, >> >> z=arange(1.0,1.05,0.05) ^^^ Tune, following up on what Curtis said, any number in the range 0 --> 1 including those end-points is okay. But the above gives on my platform the two-point array [ 1. 1.05] which is clearly out of bounds. Alternatively, for slightly different floating-point rounding it would only give you [1.] which I don't think you want. I think you meant 0.0 for the lower limit which gives on my platform [ 0. 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1. ] Which should be fine so long as some stray round-off error doesn't change that 1.0 to 1.0+eps or else stick on an extra 1.05 value at the upper limit. The 1.0 to 0.0 change might make your logic work, but better yet, I would keep the floating point logic to a minimum, that is, use integer arrays (to make sure you get the correct number of values exactly), convert them to floating point by multiplying by 0.05, then redefine the upper end (as you do already) to make sure. z = 0.05*arange(21) z[20]=1. HTH. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 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 Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |