comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Labels for Map Meridians, Parallels

Re: Labels for Map Meridians, Parallels
type: item
description: Robert Chatfield wrote: > > Has anyone written a routine that puts reasonable labels on maps drawn > by > idl? I think this routine is pretty good (if not terribly verbose)... ; Procedure to label the lat/lon values around the boundary of a map. ; ; Originator: Andrew F. Loughe (2/22/95) pro map_label, color=color, charsize=charsize, $ lhs=lhs, rhs=rhs, $ latdel=latdel, londel=londel, $ nudgex=nudgex, nudgey=nudgey, help=help ; Print a help message to the IDLTERM. if (n_elements(help) gt 0) then begin message, ' map_label, color=color, charsize=charsize,' + $ ' lhs=lhs, rhs=rhs, latdel=latdel, londel=londel,' + $ ' nudgex=nudgex, nudgey=nudgey, help=help' endif ; Set some defaults if (n_elements(color) eq 0) then color = !p.color if (n_elements(charsize) eq 0) then charsize = 0.8 lhs = keyword_set (lhs) rhs = keyword_set (rhs) if (lhs eq 0 and rhs eq 0) then lhs = 1 if (n_elements(latdel) eq 0) then latdel = 30 if (n_elements(londel) eq 0) then londel = 30 if (n_elements(nudgex) eq 0) then nudgex=0 if (n_elements(nudgey) eq 0) then nudgey=0 on_error, 2 ; Get lat/lon boundaries of the map. lonmin = !map.out(2) lonmax = !map.out(3) latmin = !map.out(4) latmax = !map.out(5) if (lonmin eq lonmax) then lonmax = lonmin + 360. DX = abs (lonmax - lonmin) ;Compute number of plots/page numperpage= (!p.multi(1) * !p.multi(2)) > 1 ; Determine character height and width. Apply charsize. char_ht = convert_coord([0,!d.y_ch_size],/device,/to_norm) char_ht = char_ht(1) * 1.0 if (!d.name ne 'X' and charsize gt 1.) then $ char_ht = char_ht * charsize char_wd = convert_coord([0,!d.x_ch_size],/device,/to_norm) char_wd = char_wd(1) ; Nudging factor (convert from data to normalized) y_avg = .5*(latmin + latmax) nudgex1 = convert_coord( [nudgex,y_avg], /data, /to_norm ) nudgex2 = convert_coord( [nudgex+nudgex,y_avg], /data, /to_norm ) nudgex = nudgex2 - nudgex1 nudgex = nudgex(0) x_avg = .5*(lonmin + lonmax) nudgey1 = convert_coord( [x_avg,nudgey], /data, /to_norm ) nudgey2 = convert_coord…
creator: Andy Loughe
date: 1996-02-07T08:00:00-00:00