|
Getting Started with IDL: Mapping |
|
You can annotate plots easily in IDL. To plot the location of selected cities in North America, as shown in the following figure, you need to create three arrays: one to hold latitudes, one to hold longitudes, and one to hold the names of the cities being plotted.
WINDOW
LATS=[40.02,34.00,38.55,48.25,17.29]
LONS=[-105.16,-119.40,-77.00,-114.21,-88.10]
CITIES=['Boulder, CO','Santa Cruz, CA',$ 'Washington, DC','Whitefish, MT','Belize, Belize']
MAP_SET,/MERCATOR,/GRID,/CONTINENT,LIMIT=[10,-130,60,-70]
PLOTS,LONS,LATS,PSYM=4,SYMSIZE=1.4,COLOR=220
The PSYM keyword makes PLOTS use diamond-shaped plotting symbols instead of connecting lines. The SYMSIZE keyword controls the size of the plotting symbols. XYOUTS draws the characters for each element of the array CITIES at the corresponding location specified by the array elements of LONS and LATS. The CHARTHICK keyword controls the thickness of the text characters and the CHARSIZE keyword controls their size (1.0 is the default size). Setting the ALIGN keyword to 0.5 centers the city names over their corresponding data points.
IDL Online Help (March 06, 2007)