Sie sind hier: Startseite / Services / Data Analysis and Visualization / Visualization / Software / NCL / examples / source_code / DKRZ NCL Workshop: maps
Info
Alle Inhalte des Nutzerportal sind nur auf Englisch verfügbar.

DKRZ NCL Workshop: maps

All map exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher

 

1. Simple map plot:

 begin

;-- open a workstation
   wks = gsn_open_wks("png", "part_II_simple_map")

;-- set resources
   res               =  True                                   ;-- create plot resource object
   res@tiMainString  = "Default Cylindrical-Equidistant projection"    ;-- draw a title on top of the plot

;-- create the plot
   plot = gsn_csm_map(wks, res)

end

 

2. Changing the projection:

begin

;-- open a workstation
   wks = gsn_open_wks("png", "part_II_projection_map")

;-- set resources
   res                        =  True               ;-- create plot resource object
   res@mpProjection           = "Mollweide"         ;-- set projection
   res@mpGridAndLimbOn        =  True               ;-- turn on grid lines
   res@tiMainString           = "Mollweide Projection"  ;-- draw a title on top of the plot

;-- create the plot
   plot = gsn_csm_map(wks, res)

end 

 

3. Select a sub-region:

begin

;-- open a workstation
   wks = gsn_open_wks("png", "part_II_subregion_map")

;-- set resources
   res               =  True               ;-- create plot resource object
   res@tiMainString  = "Europe"            ;-- draw a title on top of the plot
   res@mpMinLonF     = -11
   res@mpMaxLonF     =  45
   res@mpMinLatF     =  34
   res@mpMaxLatF     =  72

;-- create the plot
   plot = gsn_csm_map(wks, res)

end 

 

4. Change the map resolution:

begin

;-- open a workstation
   wks = gsn_open_wks("png", "part_II_resolution_map")

;-- set resources
   res                        =  True                             ;-- create plot resource object
   res@tiMainString           = "Ju~H-15V6F35~H~FV-6H3~tland"     ;-- draw a title on top of the plot
   res@mpMinLonF              =   8                               ;-- min longitude
   res@mpMaxLonF              =  13                               ;-- max longitude
   res@mpMinLatF              =  53                               ;-- min latitude
   res@mpMaxLatF              =  58                               ;-- max latitude

   res@mpDataBaseVersion      = "MediumRes"                       ;-- set map resolution
   res@mpGridAndLimbOn        =  True                             ;-- draw grid lines
   res@mpGridLineColor        = "blue"                            ;-- grid line color
   res@mpOutlineOn            =  True                             ;-- draw coastlines
   res@mpGridSpacingF         =  1                                ;-- grid line spacing
   res@mpGridLineThicknessF   =  1                                ;-- grid line thickness
   res@mpGridLineDashPattern  =  1                                ;-- grid line dash pattern
   res@mpGridAndLimbDrawOrder = "PreDraw"                         ;-- draw first the grid then the map

;-- create the plot
   plot = gsn_csm_map(wks, res)

end 

 

 

 

 

 

Artikelaktionen