function HDF=orca_hdf_plot2(hdf_root,sufx,ii_img,db_dyn,xlab,ylab, ...
	xlims,ylims,psize,symcolipt);
% Call HDF=orca_hdf_plot(hdf_root,sufx,ii_img,db_dyn,xlab,ylab, ...
%	xlims,ylims,psize,symcolipt);
%
% Images (nr>1,nc>1) or plots ORCA output file found in "out_root.mat".
% hdf_root	= root for "_hdf" file output from ORCA
% sufx		= suffix of data variable name to be plotted ([]=all);
% db_dyn 	= dynamic range to plot ([] for default min,max);
% ii_img	= 1 for 2-D image, 0 for line plots, -1 to plot rows as lines;
% dy_dyn	= dynamic range of plot, or [dmin,dmax];
% xlab,ylab	= x,y axis labels;
% xlims,ylims = spec of limits for x,y axes (see ekw_var_spec for format, []=all);
% symcolipt	= symbol, color, line type: 'or-' red circles connected with line;
%
if nargin<2, sufx=[]; end
if nargin<3, ii_img=1; end
if nargin<4, db_dyn=[]; end
if nargin<5, xlab=[]; end
if nargin<6, ylab=[]; end
if nargin<7, xlims=[]; end
if nargin<8, ylims=[]; end
if nargin<9 | isempty(psize), psize=[5,3.5]; end
if nargin<10, symcolipt=' r-2'; end

format compact
ncol=size(symcolipt,1);
if size(symcolipt,2)~=4,
	error('USER ERROR: symcolipt must have 4 columns: symbol, color, line, pt size')
end
%
if ischar(hdf_root),
	hdf_cell={hdf_root};
elseif iscell(hdf_root),
	hdf_cell=hdf_root;
else
	error('USER ERROR: hdf_root must be a string or cell array');
end
nroot=length(hdf_cell); jcol=0;
if ii_img~=1, 
% Call figure a single time for line plots
	figure; hold on; dmax=-1e300;
%	jcol=0; colors='rbgcmk'; ncol=length(colors); 
end;
nset=0; jcol=0;
% Loop over HDF file roots:
for jroot=1:nroot,
	hdf_root=char(hdf_cell(jroot));
	hdf_file=[hdf_root,'_hdf'];
	[setno,setnames]=scanhdf(hdf_file);
%
% Read in group velocities vg (first to figure out how many frequencies):
	if isempty(sufx),
		jfile=1:setno;
	else
		jfile=hdf_find(setnames,sufx);
	end
	for j=1:length(jfile);
		jf=jfile(j);
		string=['[rows,cols,data,dataname]=selecthdf(''',hdf_file,''',jf);'];
		eval(string)
		[nr,nc]=size(data);
		iix=ekw_var_spec(xlims,cols); iiy=ekw_var_spec(ylims,rows);
%
		if ~isempty(db_dyn),
			if length(db_dyn)==1, 
				dmax=max(max(data(iiy,iix))); db_dyn=[dmax-db_dyn,dmax]; 
			end
		end
		if ii_img==1,
			figure; imagesc(cols(iix),rows(iiy),data(iiy,iix));
			if ~isempty(db_dyn), set(gca,'Clim',db_dyn); end
			colormap('jet')
			plot_size(gca,'in',psize(1),psize(2));
			hc=mycolorbar2('vert');
			set(gcf,'Units','Inches','Position',[1.5,2,psize(1)+2,psize(2)+1.5])
		else
			if (nr<nc & ii_img==0) | ii_img==-1,
				for jrx=1:length(iiy),
					jr=iiy(jrx);
					jcol=jcol + 1; jset=rem(jcol-1,ncol) + 1;
					if symcolipt(jset,1)~=' ', 
						sym=symcolipt(jset,1); 
					else, 
						sym='none'; 
					end
					if symcolipt(jset,3)~=' ', 
						line=symcolipt(jset,3); 
					else, 
						line='none'; 
					end
					if symcolipt(jset,4)~=' ', 
						ptl=str2num(symcolipt(jset,4)); 
					else, 
						ptl=1.5; 
					end
					col=symcolipt(jset,2);
					plot_cfill(cols(iix),data(jr,iix),sym,col,8,line,ptl);
				end
			else
				for jcx=1:length(iix),
					jc=iix(jcx);
					jcol=jcol + 1; jset=rem(jcol-1,ncol) + 1;
					if symcolipt(jset,1)~=' ', 
						sym=symcolipt(jset,1); 
					else, 
						sym='none'; 
					end
					if symcolipt(jset,3)~=' ', 
						line=symcolipt(jset,3); 
					else, 
						line='none'; 
					end
					if symcolipt(jset,4)~=' ', 
						ptl=str2num(symcolipt(jset,4)); 
					else, 
						ptl=1.5; 
					end
					col=symcolipt(jset,2);
					plot_cfill(rows(iiy),data(iiy,jc),sym,col,8,line,ptl);
				end
			end
			plot_size(gca,'in',psize(1),psize(2));
			if ~isempty(db_dyn), ax=axis; ax(3:4)=db_dyn; axis(ax); end
			plot_set3(gca,-1.5,'Times',14,1);
		end
		mytitle(dataname);
%
		if ~isempty(xlab), xlabel(xlab); end
		if ~isempty(ylab), ylabel(ylab); end
% TEMP
%	lroot=length(hdf_root); ldata=length(dataname);
%	suffix=dataname(lroot+2:ldata);
%	if suffix(1:2)=='tl', 
%		xlabel('Range  - km'); ylabel('Depth  Ð m'); 
%	elseif suffix(1:3)=='phi' | suffix(1:3)=='sig' | suffix(1:2)=='ux' | ...
%		suffix(1:2)=='uz', 
%		xlabel('Mode Number'); ylabel('Depth  Ð m'); 
%	end;
		if ii_img==1, 
			plot_set3(gca,-1.5,'Times',14,1); 
			htemp=gca; axes(hc); plot_set3(gca,-1.5,'Times',14,1); axes(htemp);
		end
		nset=nset + 1;
		HDF(nset).title=setnames(jf,:);
		HDF(nset).x=cols;
		HDF(nset).y=rows;
		HDF(nset).data=data;
		if strcmp(HDF(nset).title(end-3:end),'rmag'),
			HDF(nset).xlab='Grazing Angle - deg';
			HDF(nset).ylab='Frequency - Hz';
			HDF(nset).dlab='Reflection Coefficient - dB';
		elseif strcmp(HDF(nset).title(end-3:end),'rph'),
			HDF(nset).xlab='Grazing Angle - deg';
			HDF(nset).ylab='Frequency - Hz';
			HDF(nset).dlab='Reflection Coefficient Phase - deg';
		else
			HDF(nset).xlab=xlab;
			HDF(nset).ylab=ylab;
			HDF(nset).dlab='';
		end
	end
end
if ii_img~=1, 
	set(gcf,'Units','Inches','Position',[1.5,2,psize(1)+1.5,psize(2)+1.5])
end
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
