[ncl-talk] adding polygons/markers to map only
Sri.durgesh Nandini-Weiss
sri.durgesh.nandini-weiss at uni-hamburg.de
Thu Feb 20 04:59:52 MST 2020
Hello dear NCL users,
I wonder if some one can help me with this script, i am trying to plot a
map only with some circles around specific lat:lon, e.g. london.
Somewhat close to ncl example: poly_8_lbar.ncl
I am also attaching the figure i want to get as well as my script.
;==============================================================
; Open the file: Read only the user specified period
; =============================================================
; =============================================================
; Extracting selected cities
; =============================================================
ylat=(/ 48., 38., 34., -1., -8., -10., -30., -45., -24., -13.,
-14., 24.,\
22., 29., 37., 41., 51., 44., 65., 36., 14., 9.,
6., -9.,\
-38., -30., -7., 24., 22., 22., 13., -13., 18., 31.,
39., 45.,\
-34., -39.,-55./)
xlon=(/-125.,-123.,-119., -81., -79., -80., -71., -57., -46., -38.,
-38., -82.,\
-80., -90., -76., -74., -71., -70., 1., -2., -30., -14.,
3., 13.,\
19., 31., 40., 67., 68., 91., 100., 107., 114., 122.,
122., 145.,\
153., 145.,-140./)
ylatr=(/ 48., 37.8, 34., -1., -8.2, -12.2, -30., -35., -24., -13.2,
-3.6, 23.5,\
25.7, 29., 36.8, 41., 42.4, 44., 51.5, 38.5, 14.5,
9., 6., -9.,\
-34.3, -30., -7., 24., 18.7, 22., 13., -5.2, 22., 31.,
39., 38.7,\
-34.4, -39.,-55./)
xlonr=(/-125.,-123.,-119., -81., -79., -77., -71.5, -57., -46., -38.2,
-38.3, -82.2,\
-80., -90., -76., -74., -71., -70., 1., -9.4, -17.6, -14.,
3., 13.,\
18.5, 31.4, 40., 67., 72.5, 91., 100., 107., 114.4, 122.,
122., 139.7,\
152.6, 145.,-140./)
city=(/"Vancouver","San Francisco","Los Angeles","Manta","Trujillo","Lima",\
"Gran La Serena","Buenos Aires","Sao
Paulo","Salvado","Fortaleza","Havana",\
"Miami","New Orleans","Virginia Beach","New
York","Boston","Portland",\
"London","Lisbon","Dakar","Conakry","Lagos","Luanda","Cape
Town","Durban",\
"Dar es Salaam","Gadap
Town","Mumbai","Chittagong","Bangkok","Jakarta",\
"Hong
Kong","Shanghai","Dalian","Tokyo","Sydney","Melbourne","Global mean"/)
;==================================================================
; Here is a section of my code that draws a color fill plot
;====================================================================
wks = gsn_open_wks("pdf","map_cities")
res = True
res at cnFillOn = True ; turn on color
res at gsnFrame = False ; don't advance frame
res at cnInfoLabelOn = False ; turn off cn info label
res at cnFillOn = True ; turn on color
res at mpDataBaseVersion = "MediumRes"
res at cnLinesOn = False
res at mpCenterLonF = 30.
res at mpOutlineOn = True
res at mpPerimOn = False
res at gsnMaximize = True ; large format in
landscape
res at mpLandFillColor = "tan"
res at mpOceanFillColor = "LightBlue"
res at mpInlandWaterFillColor = "Blue"
At this point, it of course plots a standard map only, but i haven't
figured out how to loop in the polygons based on the lat and lon of my
selected cities gridpoints.
I wonder if someone can help me code the remainder bit of it?
Would be really grateful!
Sri
--
Dr. Sri Nandini-Weiß
Research Scientist
Universität Hamburg
Center for Earth System Research and Sustainability (CEN)
Cluster of Excellence 'Climate, Climatic Change, and Society' (CLICCS)
Bundesstrasse 53, 20146 Hamburg
Tel: +49 (0) 40 42838 7472
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example_figure.png
Type: image/png
Size: 63153 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200220/89f762c5/attachment.png>
More information about the ncl-talk
mailing list