pro cont_shade,z,x,y,cont_clr=cont_clr,_extra=extras ;+ ; ; CONT_SHADE ; A procedure that creates a shaded image of an array with a contour ; plot overlaid. ; ; Call Sequence: ; CONT_SHADE, Z [, X] [, Y] [, additional graphics keywords] ; ; Inputs: ; Z - 2-D array to be resized and displayed to current X-window ; device. ; X - X-axis (optional). ; Y - Y-axis (optional). ; ; Output: ; Shaded TVSCL image with CONTOUR overlaid (to current X-window ; device). ; ; Keywords: ; Normal TVSCL and CONTOUR keywords are accepted. ; CONT_CLR - Set equal to system variable for color, if nonwhite ; contours are desired. ; ; Katie Peek / November 2005 ; ;- ; Resize array to appropriate size. xdisp = round(!x.window*!d.x_size) ydisp = round(!y.window*!d.y_size) zdisp = congrid(z,xdisp[1]-xdisp[0],ydisp[1]-ydisp[0]) ; Clear image. erase ; Display image with TVSCL. tvscl,zdisp,xdisp[0],ydisp[0],_extra=extras ; Set up X & Y axes. sz = size(z,/dimensions) if (n_elements(x) eq 0) then x = findgen(sz[0]) if (n_elements(y) eq 0) then y = findgen(sz[1]) if keyword_set(cont_clr) then clr=cont_clr else clr=!white ; Overlay contour plot with CONTOUR. contour,z,x,y,color=clr,/noerase,_extra=extras ; If /CONT_CLR is set, make overlay axes again in white. if (clr ne !white) then contour,z,x,y,color=!white,/noerase,/nodata end