[ncl-talk] contour line labels not showing

David Craig dcdavemail at gmail.com
Mon Jul 27 04:33:59 MDT 2015


Hi,
I am having trouble with contour line labels. They don't seem to appear 
on my map. A short example of how I call them is given below. Anyone see 
what the problem is?
thanks,
Dave



load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
; ================================================;


begin



   minlat = 48
   maxlat = 65
   minlon = -21
   maxlon = 0

   g = addfile("/data/davcra/GEBCO/GEBCO_2014_2D.nc", "r")
   e = g->elevation({minlat:maxlat},{minlon:maxlon})

   wks = gsn_open_wks("png", "map")               ; open a file


   res                       = True     ; plot mods desired

   res at cnFillOn                       = False     ; turn on/off color fill
   res at cnLinesOn                      = True      ; turn on/off contour 
lines
   res at cnLineLabelsOn                 = True      ; turn on/off contour 
line labels
   res at cnLevelSelectionMode           = "ExplicitLevels"      ; set 
explicit contour levels
   res at cnLevels                       = (/ -1000., -300., -150./)  ; set 
levels

   res at mpMinLatF            = minlat      ; range to zoom in on
   res at mpMaxLatF            = maxlat
   res at mpMinLonF            = minlon
   res at mpMaxLonF            = maxlon
   res at gsnAddCyclic         = False    ; data already has cyclic point

   plot = gsn_csm_contour_map(wks,e, res)

end


More information about the ncl-talk mailing list