DKRZ NCL map plot example#

DKRZ - NCL example script:

;-----------------------------------------------------------------
;
;  DKRZ - NCL Example:  NCL_map_settings.ncl
;
;  30.10.14 kmf
;-----------------------------------------------------------------
begin
;-- set file name
  diri = "./"
  fili = "rectilinear_grid_2D.nc"

;-- open file and read variable
  f    =  addfile(diri+fili, "r")
  var  =  f->tsurf(0,:,:)

;-- define the workstation (plot type and name)
  wks = gsn_open_wks("png","plot_map_settings_reg")

;-- set resources
  res                       =  True
  res@gsnMaximize           =  True            ;-- maximize graphics output

  res@lbLabelStride         =  2               ;-- every other label
  res@lbBoxMinorExtentF     =  0.15            ;-- decrease the height of the labelbar
  res@pmLabelBarOrthogonalPosF = -0.07         ;-- move the labelbar upward

  res@cnFillOn              =  True            ;-- turn on contour fill
  res@cnLinesOn             =  False           ;-- turn off contour lines
  res@cnLineLabelsOn        =  False           ;-- turn off line labels
  res@cnLevelSelectionMode  = "ManualLevels"   ;-- set contour levels manually
  res@cnMinLevelValF        =  250.            ;-- minimum contour level
  res@cnMaxLevelValF        =  310.            ;-- maximum contour level
  res@cnLevelSpacingF       =  1               ;-- contour level spacing

  res@mpProjection          = "Orthographic"   ;-- change projection
  res@mpCenterLonF          =  10              ;-- center at lon=10
  res@mpCenterLatF          =  40              ;-- center at lat=40
  res@mpDataBaseVersion     = "MediumRes"      ;-- map resolution
  res@mpGridAndLimbOn       =  True            ;-- plot grid lines
  res@mpGridLineColor       = "grey30"         ;-- set grid line color
  res@mpPerimOn             =  False           ;-- don't draw the box around the plot

  res@tiMainString          = "DKRZ - NCL Example: map settings"   ;-- title string
  res@tiMainFontHeightF     =  0.02            ;-- title font size

;-- draw the contour map
  plot = gsn_csm_contour_map(wks, var, res)

end

Result:

../../../../../../_images/plot_map_settings_reg_w400.png