clear data
colorsb=parula(6);
colorsb=colorsb([1,3,5],:);
colorsl=brighten(colorsb,0.5);
colorsd=brighten(colorsb,-0.5);
field='c';
nvec=.999:-.001:.01;
proc='cc';
%titles={'Cloud M3','Cloud M0','Cloud M6','Rain M0','Rain M6','Total M0','Total M6'};
letts='a':'f';

% if length(imomset)==3
%     ncol=5;
% else
%     ncol=1;
% end

for ifield=1:2
    if ifield==1; field='c';elseif ifield==2; field='r';else; field='f';end
    for imom=imomset%[3,0,6]
        if (strcmp(field,'f') || strcmp(field,'r')) && imom==3
            continue
        end
        jp=jp+1;
        
        nonparametric_error_evolution
        
        %subplot(ns,ncol,jp)
        subplot(2,2,jp)
        hold on
        
       % scatter(nu(datanu),data(50,:,1)-data(50,:,2),30,(M(info.M)*1e-3./(pi/6*1000*N(info.N)*1e6)).^(1/3)*1e6,'filled')
       %scatter((M(info.M)*1e-3./(pi/6*1000*N(info.N)*1e6)).^(1/3)*1e6,data(25,:,1)-data(25,:,2),30,nu(info.nu),'filled')
       
       lastreal = find(~isnan(data(end,:,1)),1,'last');
       datadiff=nan(1,ntest);
       for ii=1:lastreal
        errinds = find(data(:,ii,2)>=0.5,1,'last');
        datadiff(ii)=data(errinds,ii,1)-data(errinds,ii,2);
       end
       scatter((M(dataM)*1e-3./(pi/6*1000*N(dataN)*1e6)).^(1/3)*1e6,datadiff,30,nu(datanu),'filled')
        
        
        %set(gca,'clim',[10 60])
        set(gca,'clim',[1 15],'xlim',[10 60])
        if jp==2 
            colormap(parula(8))
            h=colorbar;             
            set(h,'ytick',1.875:7/4:14.125,'yticklabel',1:2:15)
            ylabel(h,'Shape Parameter')
        end
        
        if jp==1 || jp==3
            ylabel(['Normalized Error',10,'Cloud M3'])
        end
        if jp>=3
            %xlabel('Shape Parameter')
            xlabel('Mean Diameter')
        end
        title(titles{jp})
            
        grid on
        
        set(gca,'ylim',[-.2 0.6])
    end
end