Re: names of countries on map?

From: Jeff Van Dorn <vandorn_at_nyahnyahspammersnyahnyah>
Date: Sat, 25 Nov 2006 08:33:49 -0600

Erik,

I'm not sure if there's an automatic way to do this, which would be
cool, but when I've have to label certain cities in California I just
did it using "gsn_add_text", as in:

           plot = gsn_csm_contour_map_ce(wks,finarr,res)
           text = gsn_add_text(wks, plot, "SF", -122.43, 37.77, txres )
           text = gsn_add_text(wks, plot, "LA", -118.25, 34.05, txres )
           text = gsn_add_text(wks, plot, "SD", -117.15, 32.78, txres )
           draw(plot)
           frame(wks)

So, as long as you know the lat/lon of the area you want your text,
this should work for you, but certainly if there's an automatic way
that'd be more convenient for you.

http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_text.shtml

Jeff

ps, my "txres" just consisted of:

           txres = True
           txres_at_txFont = 22
           txres_at_txFontHeightF = 0.010

On Nov 24, 2006, at 4:47 PM, Erik Noble wrote:

> Dear NCL world
>
> Could I have some help with putting the names of countries on a map.
>
> I have figured out how to use the maponly commands to create a map of
> west Africa and the borders of the countries within that region. I
> would like to show that names of those countries as well.
>
> How do you do this?
> If it involves the commands below, how do you use them correctly?
> res_at_mpDataBaseVersion = "Ncarg4_1"
> res_at_mpDataSetName = "Earth..3"
>
>
> Thank you,
> Erik Noble
>
> ; ***********************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ;************************************************
> begin
>
> wks = gsn_open_wks("x11","west_Africa_large_imge-1") ; open an
> output file
> ;************************************************
> ; create default plot
> ;***********************************************
>
> gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
>
> res = True ; plot mods desired
> res_at_mpFillOn = False ; turn off gray fill
> res_at_cnFillOn = False ; turn on color fill
> res_at_mpDataBaseVersion = "Ncarg4_1"
> res_at_mpDataSetName = "Earth..3"
>
> res_at_cnLinesOn = True ;turn off contour lines
>
> res_at_mpOutlineBoundarySets = "AllBoundaries" ; turn on country
> boundaries
> res_at_pmTickMarkDisplayMode = "Always"
>
> res_at_mpGeophysicalLineColor = "Black" ; color of cont.
> outlines
> res_at_mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines
>
> res_at_mpMaxLatF = 35 ;west Africa region
> res_at_mpMinLatF = 5
> res_at_mpMaxLonF = 35
> res_at_mpMinLonF = -35
>
> res_at_tiMainString = "Region of Interest, West Africa, 20S-35N,
> 35W-35E"; add title
> plot = gsn_csm_map_ce(wks,res)
>
> end
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Nov 25 2006 - 07:33:49 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 28 2006 - 15:20:59 MST