Re: Frustrated by 2 Data Plotting problems [message #76317 is a reply to message #76299] |
Wed, 25 May 2011 18:41   |
Mark Piper
Messages: 198 Registered: December 2009
|
Senior Member |
|
|
Here's an example for the first problem using Direct and (New) Graphics. Works in IDL 8.1.
; Fake data at lon-lat grid nodes.
n = 100L ; try 1000L
lat = findgen(n)/(n-1)*180.0 - 90.0
lon = findgen(2*n)/(2*n-1)*360.0 - 180.0
z = cos(lat*!dtor) ## (1.0 + 0.05*randomn(1, 2*n))
; Need expansion/linearization of grid to get correct dimensions for PLOT / PLOTS.
glat = reform(lat ## (fltarr(2*n) + 1.0), 2*n^2)
glon = reform((fltarr(n) + 1.0) ## lon, 2*n^2)
gcolors = bytscl(reform(z, 2*n^2))
help, lon, lat, z, glon, glat, gcolors
; (New) Graphics.
m = map('Robinson')
g = plot(glon, glat, $
linestyle='none', $
symbol='.', $
/overplot, $
rgb_table=5, $
vert_colors=gcolors)
; Direct Graphics.
loadct, 5
map_set, /robinson
plots, glon, glat, psym=3, color=gcolors
|
|
|