|
From: Jeff W. <js...@fa...> - 2008-03-18 15:12:13
|
Rich Fought wrote:
> Hi,
>
> When using north/south polar stereographic projections from basemap, how
> can I get labels to show up on the parallels when none of them intersect
> a plot edge?
>
> Thanks,
> Rich
>
Rich: You'll have to do it manually with the axes text method. The
drawparallels method can only label them where they intersect the edge
of the map.
Something like this perhaps:
x,y = map(lon, lat) # get desired location in map projection coordinates
ax = pylab.gca() # get current axes instance
t = ax.text(x,y,latlab) # see axes.text docstring for **kwargs
where map is the basemap instance, and lat,lon is where you want the
label (latlab) to go.
latlab can be defined like this:
if latval > 0:
latlab = u'%g\N{DEGREE SIGN}N% latval
else
latlab = u'%g\N{DEGREE SIGN}S% latval
HTH,
-Jeff
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
|