From: Tune Kamae <kamae@sl...>  20041205 07:11:40

Curtis, Thank you for the prompt response. Yes, it is now working. Many thanks for your advice. Tune Kamae  Original Message  From: "Curtis Cooper" <curtis@...> To: "Tune Kamae" <kamae@...> Cc: <plplotgeneral@...> Sent: Saturday, December 04, 2004 9:37 PM Subject: Re: [Plplotgeneral] RGB mapping for plsmap1 > I think the PLplot colormap setting functions expect color ranges clamped > between [0,1]. > > Cheers, > Curtis > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * Curtis S. Cooper, Graduate Research Assistant * > * Lunar and Planetary Laboratory, University of Arizona * > * http://www.lpl.arizona.edu/~curtis/ * > * Kuiper Space Sciences, Rm. 318 * > * 1629 E. University Blvd., * > * Tucson, AZ 85721 * * * * * * * * * * * * * * * > * Wk: (520) 6211471 * > * * * * * * * * * * * * > > On Sat, 4 Dec 2004, Tune Kamae wrote: > > > Dear PLplot experts, > > > > I have been using PLplot through python/numarray to plot > > astronomical intensity maps in false color for 2 years. > > Ever since I wrote the first shaded contour plot, I have > > been wishing to improve the contrasts and the dynamic > > range of the Hue mapping. I came up with an inproved > > mapping using RGB (can also be in HSV) by making > > the function non0linear. This requires many reference > > points (eg. 20 points). > > > > Following the manual description on plshades and > > the python example xw11.py, I wrote the following > > cmap1_init_3D. But it doesn't work. > > > > I would appreciate any guidance or suggestion. > > > > T. Kamae, Stanford Linear Accelerator Center. > > > >   > > # Color map 1 in RGB space for plot3D > > # (from plplot/examples/python/xw11.py) > > > > def cmap1_init_3D(self, gray): > > """Routine for defining a specific color map 1 in > > RGB space. If gray is true, use basic grayscale > > variation from halfdark to light. Otherwise use > > a parameteized mapping to R(z), G(z), and B(z) where > > z=[0,1]. i=0 corresponds to z=1.0, the brightest > > color for this implementation. > > """ > > > > # Independent variable of control points. > > i = arange(0.0, 1.05, 0.05) > > if gray: > > # Red for control points. > > r = arange(241.0, 0.0, 12.0) > > # Green for control points. > > g = arange(241.0, 0.0, 12.0) > > # Blue for control points. > > b = arange(241.0, 0.0, 12.0) > > else: > > z=arange(1.0,1.05,0.05) > > z[20]=1.0 > > # Red for control points. > > r = 113.9*sin(7.64*z**1.705+0.701)916.1*(z+1.755)**1.862\ > > +3587.9*z+2563.4 > > rr = clip(r,0.0,255.0) > > # Green for control points. > > g = 70.0*sin(8.7*z**1.262.418)+151.7*z**0.5+70.0 > > gg = clip(g,0.0,255.0) > > # Blue for control points. > > b = 194.5*z**2.88+99.72*exp(77.24*(z0.742)**2)\ > > +45.40*z**0.089+10.0 > > bb = clip(b,0.0,255.0) > > > > # Integer flag array is zero (no interpolation along farside > > # of colour figure.) > > rev = array([0]+[1]*19+[0]) > > # number of cmap1 colours is 256 in this case. > > # smaller the number of colours, the clearer the z contour > > #plscmap1n(256) > > plscmap1n(21) > > # Interpolate between control points to set up cmap1. > > plscmap1l(1, i, rr, gg, bb, rev) > > > > > > > > > >  > > SF email is sponsored by  The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start reading now. > > http://productguide.itmanagersjournal.com/ > > _______________________________________________ > > Plplotgeneral mailing list > > Plplotgeneral@... > > https://lists.sourceforge.net/lists/listinfo/plplotgeneral > > > > 