[ncl-talk] help with mpLandFillColor

David Hebert david.hebert at nrlssc.navy.mil
Fri Aug 29 11:08:58 MDT 2014


I am trying to use mpLandFillColor on a plot to fill the land. However, 
this does not seem to be working, and I get a white background. I am 
using NCL V6.1.0. Here is the major plotting portion of the code. Any 
help is greatly appreciated!

Thank you,
David


   cmap = "BlAqGrYeOrRe"

   res             = True
   res at gsnDraw     = True
   res at gsnFrame    = True
   res at gsnMaximize = False

   res at mpProjection      = "Mercator"
   res at mpGridAndLimbOn   = True              ; turn on lat/lon lines
   res at mpPerimOn         = True             ; turn off box around plot
   res at mpGridSpacingF    = 1.
   es at mpGridLatSpacingF = 1.               ; spacing for lat lines
   res at mpGridLonSpacingF = 1.               ; spacing for lon lines
   res at mpFillOn          = False

   res at mpLimitMode       = "LatLon"     ; use lat/lon
   res at mpMinLonF         = -95.5
   res at mpMinLatF         = 29.0
   res at mpMaxLonF         = -91.5
   res at mpMaxLatF         = 30.5


   res at gsnAddCyclic          = False
   ; res at mpDataBaseVersion    = "HighRes"
   res at mpDataBaseVersion    = "MediumRes"
   res at mpDataSetName        = "Earth..4"
   res at mpOutlineSpecifiers  = (/"North America:States"/)

   res at cnFillOn         = True                ; fill contours
   res at cnFillMode       = "RasterFill"        ; turn raster on
   res at cnLinesOn        = False               ; turn off the contour lines
   res at cnLineLabelsOn   = False               ; turn off line labels
   res at cnFillDrawOrder  = "Predraw"           ; draw contours first, 
then continents

   res at trGridType           = "TriangularMesh" ; allow missing coordinates?

   res at cnLevelSelectionMode = "ManualLevels"  ; set manual contour levels
   res at gsnSpreadColors      = True            ; use full color range
   res at cnMinLevelValF       = 0.              ; set min contour level
   res at cnMaxLevelValF       = 10.           ; set max contour level
   res at cnLevelSpacingF      = 0.1              ; set contour spacing
   res at gsnSpreadColorStart  =  2              ; start at color 2
   res at gsnSpreadColorEnd    = -2              ; don't use added burlywood


   ; --- make plot
   wks = gsn_open_wks("ps","Images/elevation_max_zoom_ncl")
   gsn_define_colormap(wks,cmap)      ; choose colormap defined above


   ; add "burlywood" for land color
   bwood = (/222,184,135/) / 255.0
   bw = NhlNewColor(wks,bwood(0),bwood(1),bwood(2))
   res at mpLandFillColor  = bw
   ; res at mpLandFillColor  = "burlywood"
   plot = gsn_csm_contour_map(wks,elev,res)



More information about the ncl-talk mailing list