Basemap: Labeling parallels in polar stereographic projections

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 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 : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

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.

Thanks Jeff, that's what I was afraid of.

New question: when adding axis labels (xlabel, ylabel) and figure title, these overlap basemap parallel/meridian labels ... I suppose I'll have to manually offset these items from the axis as well?

Rich

Rich Fought wrote:

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.

Thanks Jeff, that's what I was afraid of.

New question: when adding axis labels (xlabel, ylabel) and figure title, these overlap basemap parallel/meridian labels ... I suppose I'll have to manually offset these items from the axis as well?

Rich: You can pass xlabel and ylabel a position keyword (an x,y tuple). Same for title. See the pylab.text docstring for details.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg