pro plt_str,structure,  pmulti, all=all
;
;+
; Name: PLT_STR 
;
; Purpose: Plot Structure Fields Against Subscript
;
; Input Parameters: Structure Type (Simple or Nested) 
;
; Optional Input:   Pmulti - copied into !p.multi for page formatting
;		    up to 5 element array [erase, colums, rows,...]
;
; Keyword Parameter: All - If set, then all fields are plotted
;			   Number of pages produced depends on pmulti
;			   If not set, user is prompted (menu) for tag
; 
; Calling Sequence: PLT_STR, structure [,pmulti=pmulti, /all]
;
; Example PLT_STR, structure, [0,4,5], /all
;	   (plots all fields of structure, 20/page, 4col/5rows)
; 	  
;	  PLT_STR, structure 
;	   (prompts user for tags and plots until user quits)
;
; Restrictions: Boring for non-structures 
;	        (for that matter, pretty boring for structures, too)
;		Note if ALL is set while running from X-Terminal and the
;		Number of tags > then the single page plot total as set by
;		pmulti, then plots are overwritten
;		
; Method: Straightforward (recursive for nested tags)
;  
;-
;	
pmulti_save = !p.multi		; save for original restoration
;	
if n_params() eq 2 then !p.multi=pmulti
;
;
query = not keyword_set(all)
;
tags = tag_names(structure)
tags = [tags, 'QUIT']		; add an escape route
structure_name=tag_names(structure,/structure)
;
if query then index = wmenu(tags) else index = 0
;
while strupcase(tags(index)) ne 'QUIT' do begin
   titles = structure_name + '.' + tags(index)		     
   type = size(structure.(index))
   if type(type(0) + 1) eq 8 then $
	plt_str,structure.(index),!p.multi,all=all $         ;recurse
           else plot,structure.(index),title=titles,/ynozero ;or plot
   if query then index = wmenu(tags) else index = index+1    ;next
endwhile
;
!p.multi = pmulti_save 		; avoid global effects on normal exit
return
end
