comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: latiude/ longitude legend outside the map
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: latiude/ longitude legend outside the map [message #29351 is a reply to message #29349] Wed, 13 February 2002 06:50 Go to previous messageGo to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <MPG.16d421b2f215464f989804@news.frii.com>,
David Fanning <david@dfanning.com> wrote:

> A little fooling around will quickly give you what you want.

^^^^^^^

Having the espresso this morning, eh?

Let's just say that map labeling in MAP_SET looks exactly like NCAR Graphics
ca. 1980, and that getting labels to look really good is a pain.

This is an old program that I haven't used in a while, but it will give
you a starting point.

Ken


;*********************************************************** *******************
PRO TOMS5EPSFMAP, ..., SH = sh, NH = nh

; This procedure draws a global (default), SH, or NH map.
; It has been customized for the EPSF device.

; Put your data in the ... above

title = 'map title'


; Set map projection


daspect = FLOAT(!D.Y_SIZE)/FLOAT(!D.X_SIZE)
IF KEYWORD_SET(nh) THEN BEGIN
x0 = 0.10
y0 = 0.05
x1 = 0.90
y1 = 0.85
!P.POSITION = [x0, y0, x1, y1]
MAP_SET, 90, 0, -90, /AZIMUTHAL, $ ;Set the map projection
LIMIT = [ 0, -180, 90, 180], /NOBORDER, /ISOTROPIC
j1 = nyy5/2 ;Southern edge of data area
j2 = nyy5-1 ;Northern edge of data area
ENDIF ELSE IF KEYWORD_SET(sh) THEN BEGIN
x0 = 0.10
y0 = 0.05
x1 = 0.90
y1 = 0.85
!P.POSITION = [x0, y0, x1, y1]
MAP_SET, -90, 0, 90, /AZIMUTHAL, $ ;Set the map projection
LIMIT = [-90, -180, 0, 180], /NOBORDER, /ISOTROPIC
j1 = 0 ;Southern edge of data area
j2 = nyy5/2 ;Northern edge of data area
ENDIF ELSE BEGIN
aspect = 0.5 ;Set the aspect ratio
x0 = 0.06
y0 = 0.48 - 0.45*(aspect/daspect)
x1 = 0.96
y1 = 0.48 + 0.45*(aspect/daspect)
!P.POSITION = [x0, y0, x1, y1]
MAP_SET, 0, 0, /CYLINDRICAL, $ ;Set the map projection
LIMIT = [-90, -180, 90, 180], /NOBORDER, /ISOTROPIC
j1 = 0 ;Southern edge of data area
j2 = nyy5-1 ;Northern edge of data area
ENDELSE


; Draw map here ....


IF KEYWORD_SET(nh) THEN BEGIN

DEVICE, FONT_SIZE=14
ch_size = CONVERT_COORD(!D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL)
dy = ch_size(1)
XYOUTS, 0.5, 0.95, title, /NORMAL, ALIGNMENT = 0.5

DEVICE, FONT_SIZE=10
ch_size = CONVERT_COORD(!D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL)
dy = ch_size(1)
xy = CONVERT_COORD(FLOAT(0.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(0) + deg, 1)
XYOUTS, xy(0)+0.05, xy(1)-(0.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

xy = CONVERT_COORD(FLOAT(180.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(180) + deg, 1)
XYOUTS, xy(0)-0.05, xy(1)-(0.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

xy = CONVERT_COORD(FLOAT(90.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(90) + deg + ' E', 1)
XYOUTS, xy(0), xy(1)+(0.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

xy = CONVERT_COORD(FLOAT(-90.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(90) + deg + ' W', 1)
XYOUTS, xy(0), xy(1)-(1.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

FOR yy = 30, 60, 30 DO BEGIN
xy = CONVERT_COORD(-135.0, FLOAT(yy), /DATA, /TO_NORMAL)
IF(yy LT 0) THEN hemi = ' S' ELSE IF(yy GT 0) THEN hemi = ' N' ELSE hemi = ' '
ylabel = STRTRIM(STRING(ABS(yy)) + deg + hemi, 1)
XYOUTS, xy(0)-0.0075, xy(1)-dy/2, ylabel, /NORMAL, ALIGNMENT = 0.5
ENDFOR

ENDIF ELSE IF KEYWORD_SET(sh) THEN BEGIN

DEVICE, FONT_SIZE=14
ch_size = CONVERT_COORD(!D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL)
dy = ch_size(1)
XYOUTS, 0.5, 0.95, title, /NORMAL, ALIGNMENT = 0.5

DEVICE, FONT_SIZE=10
ch_size = CONVERT_COORD(!D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL)
dy = ch_size(1)
xy = CONVERT_COORD(FLOAT(0.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(0) + deg, 1)
XYOUTS, xy(0)+0.05, xy(1)-(0.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

xy = CONVERT_COORD(FLOAT(180.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(180) + deg, 1)
XYOUTS, xy(0)-0.05, xy(1)-(0.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

xy = CONVERT_COORD(FLOAT(90.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(90) + deg + ' E', 1)
XYOUTS, xy(0), xy(1)-(1.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

xy = CONVERT_COORD(FLOAT(-90.0), 0.0, /DATA, /TO_NORMAL)
xlabel = STRTRIM(STRING(90) + deg + ' W', 1)
XYOUTS, xy(0), xy(1)+(0.5*dy), xlabel, /NORMAL, ALIGNMENT = 0.5

FOR yy = -60, -30, 30 DO BEGIN
xy = CONVERT_COORD(-135.0, FLOAT(yy), /DATA, /TO_NORMAL)
IF(yy LT 0) THEN hemi = ' S' ELSE IF(yy GT 0) THEN hemi = ' N' ELSE hemi = ' '
ylabel = STRTRIM(STRING(ABS(yy)) + deg + hemi, 1)
XYOUTS, xy(0)-0.0075, xy(1)-dy/2, ylabel, /NORMAL, ALIGNMENT = 0.5
ENDFOR

ENDIF ELSE BEGIN

DEVICE, FONT_SIZE=14
ch_size = CONVERT_COORD(!D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL)
dy = ch_size(1)
xy = CONVERT_COORD(0.0, 90.0, /DATA, /TO_NORMAL)
XYOUTS, xy(0), xy(1)+1.5*dy, title, /NORMAL, ALIGNMENT = 0.5

DEVICE, FONT_SIZE=10
ch_size = CONVERT_COORD(!D.X_CH_SIZE, !D.Y_CH_SIZE, /DEVICE, /TO_NORMAL)
dy = ch_size(1)
FOR xx = -180, 180, 90 DO BEGIN
xy = CONVERT_COORD(FLOAT(xx), -90.0, /DATA, /TO_NORMAL)
IF(xx LT 0) THEN hemi = ' W' ELSE IF(xx GT 0) THEN hemi = ' E' ELSE hemi = ''
xlabel = STRTRIM(STRING(ABS(xx)) + deg + hemi, 1)
XYOUTS, xy(0), xy(1)-(1.7*dy), xlabel, /NORMAL, ALIGNMENT = 0.5
ENDFOR

FOR yy = -90, 90, 30 DO BEGIN
xy = CONVERT_COORD(-180.0, FLOAT(yy), /DATA, /TO_NORMAL)
IF(yy LT 0) THEN hemi = ' S' ELSE IF(yy GT 0) THEN hemi = ' N' ELSE hemi = ' '
ylabel = STRTRIM(STRING(ABS(yy)) + deg + hemi, 1)
XYOUTS, xy(0)-0.0075, xy(1)-dy/2, ylabel, /NORMAL, ALIGNMENT = 1.0
ENDFOR

ENDELSE

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Object method compiling
Next Topic: Re: Object/Direct Graphics Question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 18:44:37 PST 2025

Total time taken to generate the page: 0.64331 seconds