Plotting two-dimensional data: {Gumley, 6.7-6.9} IDL> f=RANDOMU(-100,50,50) this produces a 2D, floating point array of random numbers between 0. and 1. using "-100" as the random number seed. IDL> DEVICE,DECOMPOSED=0 IDL> LOADCT,33 Contour plots: IDL> CONTOUR,f,COLOR=150 IDL> CONTOUR,f,COLOR=150,XSTYLE=1,YSTYLE=1 IDL> f=SMOOTH(f,4,/EDGE_TRUNCATE) ; the "4" is the chosen smoothing width IDL> CONTOUR,f,COLOR=150,XSTYLE=1,YSTYLE=1 IDL> f=SMOOTH(f,4,/EDGE_TRUNCATE) IDL> CONTOUR,f,COLOR=150,XSTYLE=1,YSTYLE=1 IDL> f=SMOOTH(f,4,/EDGE_TRUNCATE) IDL> CONTOUR,f,COLOR=150,XSTYLE=1,YSTYLE=1 IDL> x=FINDGEN(50)*10. IDL> y=2*x IDL> CONTOUR,f,x,y,COLOR=150,XSTYLE=1,YSTYLE=1,NLEVELS=10,/FOLLOW note, /FOLLOW labels the contours with their values IDL> CONTOUR,f,x,y,XSTYLE=1,YSTYLE=1,NLEVELS=10,/FILL IDL> PRINT,MIN(f),MAX(f) IDL> levs=[0.493,0.512,0.523,0.525,0.54] IDL> CONTOUR,f,x,y,XSTYLE=1,YSTYLE=1,LEVELS=levs,/FILL IDL> CONTOUR,f,x,y,COLOR=150,XSTYLE=1,YSTYLE=1,LEVELS=levs,/FOLLOW Surface plots: IDL> SURFACE,f,x,y,COLOR=150,ZRANGE=[0.4,0.6] IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f) IDL> SURFACE,f,x,y,COLOR=150,ZRANGE=[0.4,0.6],SKIRT=0.4 You can chane the viewpoint in surface plots by specifying the keywords AX and AZ, which give the rotation angle about the X and Z axes. The default values are 30 and 30. IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AX=30 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AX=40 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AX=50 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AX=60 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AZ=30 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AZ=40 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AZ=50 IDL> SHADE_SURF,f,x,y,ZRANGE=[0.4,0.6],SHADES=BYTSCL(f),AZ=60 do a "? map_set" to check the various options for map projections IDL> LOADCT,0 IDL> MAP_SET,/MERCATOR IDL> MAP_CONTINENTS IDL> MAP_SET,45.,-90.,/SINUSOIDAL,SCALE=75.e6 if SCALE is set, the scale of the map will be 1:SCALE. if SCALE is not set, the map will be fitted to the window. IDL> MAP_CONTINENTS IDL> MAP_SET,/AITOFF,/HORIZON IDL> MAP_CONTINENTS IDL> MAP_SET,/ORTHOGRAPHIC,/HORIZON,/ISOTROPIC,/NOBORDER /ISOTROPIC scales the x and y directions the same, independent of the window. IDL> MAP_CONTINENTS IDL> MAP_GRID make a 2D array, sph, that has an interesting pattern in latitude and longitude IDL> nx=100 IDL> ny=50 IDL> sph=FLTARR(nx,ny) IDL> lon=FINDGEN(nx)*360./(nx-1) ; longitudes in degrees IDL> lat=FINDGEN(ny)*180./(ny-1)-90. ; latitudes in degrees IDL> lonr=lon*!DTOR ; longitudes in radians IDL> latr=lat*!DTOR ; latitudes in radians IDL> FOR i=0,nx-1 DO FOR j=0,ny-1 DO sph[i,j]=SIN(4*latr[j])*COS(5*lonr[i]) IDL> PRINT,sph[*,0] IDL> sph[*,0]=0. ; south pole IDL> sph[*,ny-1]=-1.01 ; north pole - this is done to fix the CONTOUR plot map this 2D array onto a sphere IDL> MAP_SET,/ORTHOGRAPHIC,/HORIZON,/ISOTROPIC,/NOBORDER IDL> MAP_GRID IDL> CONTOUR,sph,lon,lat,/OVERPLOT note, this generates an error, don't worry about it IDL> LOADCT,33 IDL> CONTOUR,sph,lon,lat,NLEVELS=10,/OVERPLOT,/CELL_FILL note, /CELL_FILL works better than /FILL for map projections IDL> MAP_CONTINENTS IDL> OPLOT,[-20.],[-30.],PSYM=4,COLOR=250,SYMSIZE=2. note, use /OVERPLOT as a keyword for CONTOUR and OPLOT as a procedure that here knows about the previous call to MAP_SET IDL> XYOUTS,[-20.],[-30.],' Site 1' note, PLOT and OPLOT require x and y to be arrays even though here they are one-element arrays but XYOUTS can be used with single variables or arrays. IDL> XYOUTS,-25.,-35.,' Site 1' IDL> OPLOT,[0.],[0.],PSYM=4,COLOR=200 IDL> XYOUTS,[0.],[0.],' Site 2' note, for MAP_SET: lat, lon but for PLOT, CONTOUR and XYOUTS: x, y or lon, lat if MAP_SET