mpFillColors and nglSpreadColors

From: Derrick Snowden <Derrick.Snowden_at_nyahnyahspammersnyahnyah>
Date: Wed, 20 Oct 2004 21:21:43 -0400

I'm having difficulty deciphering how the colors in a colormap are assigned to
various elements in the plot. I'm following the chkbay.py example from
pynglex somewhat.

I'm trying to figure out the colors which are assigned to the background (I
assume element 0), foreground(1), land, ocean, etc.

I am able to set the foreground and background correctly.

resources = ngl.Resources()
rlist = ngl.Resources()
rlist.wkColorMap = 'BlueRedGray'
ngl.set_values(wks,rlist)
resources.mpFillOn = True # Turn on map fill.
resources.mpLandFillColor = 254
resources.mpOceanFillColor = -1

This gives me a white background with black letters and a gray fill color for
land, which is what I want. But, I also get a gray box in the "warmest"
value for my colorbar. I have tried the nglSpreadColors resource like so ...

resources.nglSpreadColors = True
resources.nglSpreadColorsEnd=-2

which I then pass to the map function ...
map = ngl.contour_map(wks,sstma,resources) # Draw contours over a map.

This has no effect that I can see. I thought it would tell the contour
function to stop using the colormap at the ncol - 2 entry. Is this the wrong
interpretation or am I doing something else?

On that note, is there a way, short of defining your own colormap as a Numeric
array, that you can find the length of a colormap in order to know beforehand
the indices to assign to mpOceanFillColor?

Any help is appreciated,
Derrick

-- 
Derrick Snowden
PhOD/AOML/NOAA
4301 Rickenbacker Causeway
Miami, FL 33149
Office: 305.361.4322  Fax: 305.361.4392
_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Wed Oct 20 2004 - 19:22:36 MDT

This archive was generated by hypermail 2.2.0 : Thu Jan 19 2006 - 21:30:16 MST