function [ierr] = plotELCOMicFile(filename,data,data_type,locn,n_data,pltTheme) % function [ierr] = plotELCOMicFile(filename,data,data_type,locn,n_data,pltTheme) % % funcion to plot ELCOM boundary condition file input file % outputs figures as eps and tiff % % Inputs Mostly from readELCOMinputFile: % filename : filename used for plot title % data : matrix of data (1st column is time or depth) % data_type : cell array of data_types in file % locn : i,j location of profile) % n_data : no of data columns specified in header % file_type : File type (one of 'BC','PROFILE','INITIAL') % pltTheme : (optional) string for input to setPlotTheme % % Outputs % ierr : error flag % % Uses: % exportfig.m % CWRdate2matlab.m % % Written by C. Dallimore 27 July 04 if nargin == 6 elseif nargin == 5 pltTheme = []; else disp('Incorrect number of arguments to plotELCOMicFile') ierr =1; return end ierr = 0; % Setup units of various input types variable_mat = setELCOMioTypes; for (i = 1:n_data) figure plot (data(:,i+1),data(:,1),'-x') xl = get(gca,'xlim'); set(gca,'xlim',[xl(1)-0.5 xl(2)+0.5]); % Y axis ylabel('Depth (m)') set (gca,'ydir','reverse') % X axis variable = char(data_type(i+1)); fv=strmatch(variable,variable_mat(:,1),'exact'); if (isempty(fv)) xtitle = variable; else xtitle = [char(variable_mat(fv,2)),' (',char(variable_mat(fv,3)),')']; end xlabel (xtitle) % Title titlestr = ['IC FILE: ',filename,' i: ',int2str(locn(1)),' j: ',int2str(locn(2))]; figtitle = [filename(1:length(filename)-4),'-',variable]; titlestr(findstr(titlestr,'_'))='-'; title(titlestr) setPlotTheme(pltTheme); % Output to file opts = struct('width',3.5,'color','rgb','renderer','painters'); exportfig (gcf,[figtitle,'.eps'],opts,'format','eps','preview','tiff'); exportfig (gcf,[figtitle,'.jpg'],opts,'format','jpeg','resolution',100); end