function srdPlots(srd)
%
%==========================================================================

%
% Extract the srd values, relative frequencies, probabilities
%
nFold=length(srd.nrow);
nCol=size(srd.prob,2);  
xpdf=bsxfun(@times,srd.x,srd.scale);
ypdf=srd.relFreq;
prob=srd.prob;
nsrd=srd.norm;
if nFold > 1
    xpdf=median(xpdf); 
    ypdf=median(ypdf);
    prob=median(prob);
    nsrd=median(nsrd);
end    

%
% FIGURE 1: Plot the srd distribution with ranks
%
figure;
set(gcf,'color',[1 1 1]);
% plot the distribution
hbar=bar(xpdf,ypdf,2); 
set(gca,'color',[.6 .6 .6]);
set(hbar,'facecolor',[.7 .7 1],'edgecolor',[.8 .8 1]);
% Overlay the SRD values across reg. params. on the distribution
[~,idx]=sort(nsrd);
% numerical ranks 
rankString=cellstr(num2str([1:nCol]'));     
xText=nsrd;
yText=max(ypdf)*0.9*ones(1,nCol);
htext=text(xText,yText,rankString);
set(htext,'horizontalAlignment','center',...
          'verticalAlignment','middle',...
          'fontsize',9,'color','y');
% lines associated with numerical ranks
xline=[nsrd; nsrd];
yline=[0*nsrd; 0.95*yText];
hline=line(xline,yline);
set(hline,'color',[1 .5 .5]);
% x- and y-axis labels
xlabel('Normalized SRD');
ylabel('Probability Density Function Value');
% axes properties
set(gca,'xlim',[-0.5 100.5]);
grid on;

%
% Figure 2: Plot srd as a function of probability
%
figure;
set(gcf,'color',[1 1 1]);
% Plot the SRD distribution.
prob=max(prob,eps);
hplot=semilogy(nsrd,prob,'o'); 
set(hplot,'linewidth',2,'markerfacecolor',[1 .5 .5],...
                        'markeredgecolor',[1 .5 .5],...
                        'markersize',4);
htext=text(nsrd,prob,rankString);
set(htext,'color','y','fontsize',9,...
                  'horizontalAlignment','left',...
                  'verticalAlignment','top');
% x- and y-axis labels
xlabel('Normalized SRD Value');
ylabel('Probability: P(X < NSRD)');
% axes properties
prec=5;
xlim(1)=floor(min(nsrd)/prec)*prec;
xlim(2)=ceil(max(nsrd)/prec)*prec;
ylim=get(gca,'ylim'); ylim(1)=ylim(1)/2;
set(gca,'color',[.6 .6 .6],'ylim',ylim,'xlim',xlim);
grid on;  

%==========================================================================
end

