; + 
; PRO SetGraf 
; -------------------------------- last changed:  26-sep 
; AUTHOR  aph 
; 
; switches between the 3Draw Windows in AXIS.PRO 
; variable NAME is CASE-SENSITIVE !! 
; only allowed values are:  'MainImg'  'XZPlot'   'YZPlot' 
; if keyword SET , the scaling parameters for Window, NAME are saved 
; 
;  REVISION HISTORY 
; (27-may-97 aph) first written 
; (12-aug-99 aph) removed from aaa_axis  (axis_c) 
; (26-sep-99 aph) removed Thumbnails when went to individual plots 
; - 
 
PRO SetGraf, Name, SET=set 
 
@axis_com		; include COMMON from file 
 
on_error,2 
  CASE NAME OF          ; identify the window 
	'MainImg':		i=0 
	'XZPlot' : 		i=1 
    'YZPlot' : 		i=2 
	ELSE     : begin 
		print, 'Invalid graf name: ', name 
		return 
	ENDELSE 
ENDCASE 
if keyword_set(SET) then Begin 
   Xold(i,*) = !X.S 
   Yold(i,*) = !Y.S 
   return 
endif else Begin 
  CASE NAME OF          ; identify the window 
	'MainImg': 	BEGIN 
			wset, MainImg 
			i=0 
		END 
	'XZPlot' : 	BEGIN 
			wset, XZPlot 
			i =1 
		END 
    'YZPlot' : 	BEGIN 
    		wset, YZPlot 
			i = 2 
    	END 
   ENDCASE 
    !X.S = Xold(i,*)   	; restore image (x,y) scaling parameters 
    !Y.S = Yold(i,*) 
    return 
endelse 
END 
