Index: /issm/trunk/src/m/classes/public/plot/plot_manager.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_manager.m	(revision 5420)
+++ /issm/trunk/src/m/classes/public/plot/plot_manager.m	(revision 5421)
@@ -33,7 +33,16 @@
 			plot_segmentnumbering(md,options,subplotwidth,i);
 			return;
-		case 'histnorm',
+		case 'qmuhistnorm',
 			plot_qmuhistnorm(md,options,subplotwidth,i);
 			return;
+		
+		case 'qmuhistnorm',
+			plot_qmuhistnorm(md,options,subplotwidth,i);
+			return;
+
+		case 'qmu_mass_flux_segments',
+			plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
+			return;
+
 		case 'part_hist',
 			plot_parthist(md,options,nlines,ncols,i);
@@ -45,8 +54,5 @@
 			plot_gridnumbering(md,options,subplotwidth,i);
 			return;
-		case 'qmu_mass_flux_segments',
-			plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
-			return;
-
+		
 		case 'highlightgrids',
 			plot_highlightgrids(md,options,subplotwidth,i);
Index: /issm/trunk/src/m/classes/public/plot/plot_qmuhistnorm.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_qmuhistnorm.m	(revision 5420)
+++ /issm/trunk/src/m/classes/public/plot/plot_qmuhistnorm.m	(revision 5421)
@@ -1,268 +1,36 @@
-%
-%  plot a relative histogram and cdf optionally along with
-%  a normal distribution.
-%
-%  []=plot_qmuhistnorm(dresp1   ,dresp2  ,hmin,hmax,hnint)
-%  []=plot_qmuhistnorm(samp,desc,mu,sigma,hmin,hmax,hnint)
-%
-%  where the required input is:
-%    dresp1        (structure array, responses)
-%      or
-%    samp          (double array, lists of samples)
-%    desc          (cell array, list of descriptions)
-%
-%  and the optional input is:
-%    dresp2        (structure array, responses)
-%      or
-%    mu            (double vector, means)
-%    sigma         (double vector, standard deviations)
-%
+function plot_qmuhistnorm(md,options,width,i);
+
+%recover histnorm data
+if ~exist(options,'qmudata')
+	error('plot_qmuhistnorm error message: option qmudata is required');
+else
+	qmudata=getfieldvalue(options,'qmudata');
+end
+
+%process options for the qmu plot: 
+
 %    hmin          (numeric, minimum for histogram)
 %    hmax          (numeric, maximum for histogram)
 %    hnint         (numeric, number of intervals for histogram)
-%
-%  the required fields of dresp1 are:
-%    descriptor    (char, description)
-%    sample        (double vector, list of samples)
-%
-%  and the required fields of dresp2 are:
-%    mean          (double, mean of sample)
-%    stddev        (double, standard deviation of sample)
-%
-%  for each response in the input array, this function
-%  calculates and plots a relative histogram and CDF of the list
-%  of samples, and annotates it with the description.  in
-%  addition, a mean and standard deviation may be supplied or
-%  calculated so that a normal distribution and CDF may be
-%  plotted.
-%
-%  dresp1 data would typically be contained in the dakota tabular
-%  output file from a sampling analysis, and dresp2 data would
-%  typically be contained in the dakota output file from a local
-%  sensitivity analysis, both read by dakota_out_parse.
-%
-%  "Copyright 2009, by the California Institute of Technology.
-%  ALL RIGHTS RESERVED. United States Government Sponsorship
-%  acknowledged. Any commercial use must be negotiated with
-%  the Office of Technology Transfer at the California Institute
-%  of Technology.  (NTR 47078)
-%
-%  This software may be subject to U.S. export control laws.
-%  By accepting this  software, the user agrees to comply with
-%  all applicable U.S. export laws and regulations. User has the
-%  responsibility to obtain export licenses, or other export
-%  authority as may be required before exporting such information
-%  to foreign countries or providing access to foreign persons."
+%    ymin1         (numeric, minimum of histogram y-axis)
+%    ymax1         (numeric, maximum of histogram y-axis)
+%    ymin2         (numeric, minimum of cdf y-axis)
+%    ymax2         (numeric, maximum of cdf y-axis)
+%    cdfplt        (char, 'off' to turn off cdf line plots)
+%    cdfleg        (char, 'off' to turn off cdf legends)
 %
 
+qmuoptions='';
 
-function plot_qmuhistnorm(md,options,width,i);
+if exist(options,'hmin'), hmin=getfieldvalue(options,'hmin'); qmuoptions=[qmuoptions ',''hmin'',' num2str(hmin)]; end
+if exist(options,'hmax'), hmax=getfieldvalue(options,'hmax'); qmuoptions=[qmuoptions ',''hmax'',' num2str(hmax)]; end
+if exist(options,'hnint'), hnint=getfieldvalue(options,'hnint'); qmuoptions=[qmuoptions ',''hnint'',' num2str(hnint)]; end
+if exist(options,'ymin1'), ymin1=getfieldvalue(options,'ymin1'); qmuoptions=[qmuoptions ',''ymin1'',' num2str(ymin1)]; end
+if exist(options,'ymax1'), ymax1=getfieldvalue(options,'ymax1'); qmuoptions=[qmuoptions ',''ymax1'',' num2str(ymax1)]; end
+if exist(options,'ymin2'), ymin2=getfieldvalue(options,'ymin2'); qmuoptions=[qmuoptions ',''ymin2'',' num2str(ymin2)]; end
+if exist(options,'ymax2'), ymax2=getfieldvalue(options,'ymax2'); qmuoptions=[qmuoptions ',''ymax2'',' num2str(ymax2)]; end
+if exist(options,'cdfplt'), cdfplt=getfieldvalue(options,'cdfplt'); qmuoptions=[qmuoptions ',''cdfplt'',' cdfplt]; end
+if exist(options,'cdfleg'), cdfleg=getfieldvalue(options,'cdfleg'); qmuoptions=[qmuoptions ',''cdfleg'',' cdfleg]; end
 
-%recover histnorm data
-if ~exist(options,'histnorm_data')
-	error('plot_qmuhistnorm error message: option histnorm_data is required');
-else
-	varargin=getfieldvalue(options,'histnorm_data');
-end
-
-%recover fontsize
-fontsize=getfieldvalue(options,'fontsize',18),
-
-nargin=length(varargin);
-
-%%  process input data and assemble into matrices as needed
-ivar=1;
-if isstruct(varargin{ivar})
-    dresp1=varargin{ivar};
-    ivar=ivar+1;
-    
-    desc=cell (1,length(dresp1));
-    lsamp=zeros(1,length(dresp1));
-    for i=1:length(dresp1)
-        lsamp(i)=length(dresp1(i).sample);
-    end
-    samp=zeros(max(lsamp),length(dresp1));
-    samp(:,:)=NaN;
-
-    for i=1:length(dresp1)
-        desc(i)=cellstr(dresp1(i).descriptor);
-        samp(1:lsamp(i),i)=dresp1(i).sample;
-    end
-else
-    samp=varargin{ivar};
-    ivar=ivar+1;
-    
-    lsamp(1:size(samp,2))=size(samp,1);
-
-    if ivar <= nargin && iscell(varargin{ivar})
-        desc=varargin{ivar};
-        ivar=ivar+1;
-    else
-        desc={};
-    end 
-end
-
-if     ivar <= nargin && isstruct(varargin{ivar})
-    dresp2=varargin{ivar};
-    ivar=ivar+1;
-
-    mu   =zeros(1,length(dresp2));
-    sigma=zeros(1,length(dresp2));
-
-    for i=1:length(dresp2)
-        mu   (i)=dresp2(i).mean;
-        sigma(i)=dresp2(i).stddev;
-    end
-elseif ivar+1 <= nargin
-    if isnumeric(varargin{ivar})
-        if ~isempty(varargin{ivar})
-            mu   =varargin{ivar};
-        else
-            mu   =mean(samp);
-            display('Using calculated means.')
-        end
-    end
-    ivar=ivar+1;
-    if isnumeric(varargin{ivar})
-        if ~isempty(varargin{ivar})
-            sigma=varargin{ivar};
-        else
-            sigma=std(samp);
-            display('Using calculated standard deviations.')
-        end
-    end
-    ivar=ivar+1;
-end
-
-%%  generate the intervals
-
-if ivar <= nargin && ~isempty(varargin{ivar})
-    hmin=varargin{ivar};
-else
-    hmin=min(min(samp));
-end
-ivar=ivar+1;
-if ivar <= nargin && ~isempty(varargin{ivar})
-    hmax=varargin{ivar};
-else
-    hmax=max(max(samp));
-end
-ivar=ivar+1;
-if ivar <= nargin && ~isempty(varargin{ivar})
-    hnint=varargin{ivar};
-else
-    hnint=50;
-end
-ivar=ivar+1;
-edges=hmin:(hmax-hmin)/hnint:hmax;
-
-%%  generate the histogram counts and make them relative
-
-%  note that for the histc function:
-%  n(k) counts the value x(i) if edges(k) <= x(i) < edges(k+1).
-%  The last bin counts any values of x that match edges(end).
-%  Values outside the values in edges are not counted.
-%  Use -inf and inf in edges to include all non-NaN values.
-
-dhistc=histc(samp,edges);
-for i=1:size(samp,2)
-    dbelow(i)  =length(find(samp(:,i)<edges(  1)))/lsamp(i);
-    dhistc(:,i)=dhistc(:,i)                       /lsamp(i);
-    dabove(i)  =length(find(samp(:,i)>edges(end)))/lsamp(i);
-end
-
-if exist('mu','var') && exist('sigma','var')
-    ncol=size(samp,2);
-    for i=1:ncol
-        dbelow(ncol+i)=normcdf(edges(  1),mu(i),sigma(i));
-        dhistc(1:size(dhistc,1)-1,ncol+i)=...
-            normcdf(edges(2:end  ),mu(i),sigma(i))-...
-            normcdf(edges(1:end-1),mu(i),sigma(i));
-        dabove(ncol+i)=norminv(edges(end),mu(i),sigma(i));
-        if exist('desc','var')
-            desc(ncol+i)={[desc{i} ' norm']};
-        end
-    end
-end
-
-%  draw the bar plot
-
-hl1=bar(edges(1:end-1),dhistc(1:end-1,:));
-ax1=gca;
-
-%  add the annotation
-ylabel('Relative Frequency','Fontsize',fontsize);
-
-if exist('desc','var')
-    hleg1=legend(ax1,desc,'Location','NorthWest',...
-                 'Interpreter','none');
-else
-    hleg1=legend(ax1);
-end
-
-%%  generate the cumulative distribution functions
-
-% cdf=zeros(size(dhistc));
-% cdf(1,:)=dhistc(1,:);
-% for i=2:size(dhistc,1)
-%     cdf(i,:)=cdf(i-1,:)+dhistc(i,:);
-% end
-cdf=cumsum(dhistc);
-for i=1:size(dhistc,2)
-    cdf(:,i)=dbelow(i)+cdf(:,i);
-end
-if exist('desc','var')
-    ncol=length(desc);
-    for i=1:ncol
-        cdesc(i)={[desc{i} ' cdf']};
-    end
-end
-
-%  draw the line plot
-
-%  (see "Using Multiple X- and Y-Axes" and "Overlaying Other
-%  Plots on Bar Graphs", or search on "YAxisLocation right")
-
-%hold all
-%hold on
-%plot(edges,cdf)
-%plotyy([],[],edges,cdf)
-
-%  ticks from the bar plot will show through, so make ticks
-%  from the line plot match
-
-nytick=length(get(ax1,'YTick'));
-ytmax =ceil(max(max(cdf))/0.1-0.1)*0.1;
-ytinc =ytmax/(nytick-1-1);
-
-ax2=axes('Position',get(ax1,'Position'),...
-         'XLim',get(ax1,'XLim'),...
-         'YLim',[0 ytinc*(nytick-1)],...
-         'YTick',[0:ytinc:ytinc*(nytick-1)],...
-         'XAxisLocation','bottom','YAxisLocation','right',...
-         'Color','none','Layer','top');
-hl2=line(edges(1:end-1),cdf(1:end-1,:),'Parent',ax2);
-       
-%  add the annotation
-
-ylabel('Cumulative Percent','FontSize',fontsize)
-
-% legend doesn't combine with bar chart above
-if exist('cdesc','var')
-    hleg2=legend(ax2,cdesc,'Location','NorthEast',...
-                 'Interpreter','none');
-    set(hleg2,'Color','white')
-else
-    hleg2=legend(ax2);
-    set(hleg2,'Color','white')
-end
-
-set(gcf,'PaperPositionMode','auto')
-%hold off
-
-
-%apply options.
-options=addfielddefault(options,'title','Relative Frequency Histogram');
-options=addfielddefault(options,'xlabel','Interval Edge Value');
-options=addfielddefault(options,'colorbar',0);
-applyoptions(md,[],options);
+%use qmu plot
+eval(['plot_hist_norm(qmudata' qmuoptions ');']);
Index: /issm/trunk/src/m/classes/public/plot/plotdoc.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plotdoc.m	(revision 5420)
+++ /issm/trunk/src/m/classes/public/plot/plotdoc.m	(revision 5421)
@@ -46,10 +46,6 @@
 disp('                  - ''transient_movie_time'': time for each image (default 2 seconds)');
 disp('                  - ''thermaltransient_results'': this will display all the time steps of a thermal transient run');
-disp('                  - ''normplot'': norm plot');
-disp('                  - ''histnorm'': histogram normal distribution. needs option histnorm_data');
+disp('                  - ''qmuhistnorm'': histogram normal distribution. needs option qmudata');
 disp('                  - ''part_hist'': partitioning node and area histogram');
-
-answer = lower(input(['more?(y/n) \n'],'s'));
-if ~strcmp(answer,'y'), return, end
 
 disp('       ''alloptions'': apply the options to all subplots if ''on''');
@@ -125,5 +121,5 @@
 disp('       ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)');
 disp('       ''unit'': by default, in m, otherwise, ''km'' is available');
-disp('       ''histnorm_data'': data for histnorm plot.');
+disp('       ''qmudata'': data for qmu  plots.');
 disp('                  {dresp1   ,dresp2  ,hmin,hmax,hnint} or {samp,desc,mu,sigma,hmin,hmax,hnint}');
 disp('                  where dresp1 is a structure array of responses (where we need samp and desc), ');
@@ -131,4 +127,13 @@
 disp('                  hmin,hmax and hnint are the minimum, maximum and number of intervals of the histogram (optional)');
 disp('       ''position'': position of figure. specify name of person for which position settings are hardcoded in applyoptions.m');
+disp('       ''hmin'': (numeric, minimum for histogram)');
+disp('       ''hmax'': (numeric, maximum for histogram)');
+disp('       ''hnint'': (numeric, number of intervals for histogram)');
+disp('       ''ymin1'': (numeric, minimum of histogram y-axis)');
+disp('       ''ymax1'': (numeric, maximum of histogram y-axis)');
+disp('       ''ymin2'': (numeric, minimum of cdf y-axis)');
+disp('       ''ymax2'': (numeric, maximum of cdf y-axis)');
+disp('       ''cdfplt'': (char, ''off'' to turn off cdf line plots)');
+disp('       ''cdfleg'': (char, ''off'' to turn off cdf legends)');
 disp('       any options (except ''data'') can be followed by ''#i'' where ''i'' is the subplot number, or ''#all'' if applied to all plots');
 disp('  ');
