Sie sind hier: Startseite / Services / Data Analysis and Visualization / Visualization / Software / NCL / examples / source_code / DKRZ NCL contour lines plot example (rectilinear grid)
Info
Alle Inhalte des Nutzerportal sind nur auf Englisch verfügbar.

DKRZ NCL contour lines plot example (rectilinear grid)

NCL contour lines plot example for data on a rectilinear grid.

DKRZ NCL example script:

;-----------------------------------------------------------------
; 
;  NCL Doc Example:  NCL_filled_contour_map.ncl
; 
;  30.10.14 kmf
;-----------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

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_contour_lines_rect")

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

  res@cnFillOn              =  False           ;-- turn on contour fill
  res@cnLevelSelectionMode  = "ManualLevels"   ;-- set contour levels manually
  res@cnMinLevelValF        =  250.            ;-- minimum contour level
  res@cnMaxLevelValF        =  310.            ;-- maximum contour level
  res@cnLevelSpacingF       =  2               ;-- contour level spacing

  res@lbBoxMinorExtentF     =  0.15            ;-- decrease the height of the labelbar

  res@tiMainString          = "DKRZ - NCL Example: contour lines (rectilinear grid)" ;-- title string
  res@tiMainFontHeightF     =  0.02            ;-- title font size

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

end

Artikelaktionen