function MDN_pdfwithsd(numofblindwell,time,y_train,yy_train,sd_train,pdf_train,train_indices,y_test,yy_test,sd_test,pdf_test,test_indices,h,por_range)

figure(h)
subplot(1,7,numofblindwell)

por=nan(length(time),1);
por(train_indices)=y_train;
por(test_indices)=y_test;

por_train=nan(length(time),1);
por_train(train_indices)=yy_train;

por_test=nan(length(time),1);
por_test(test_indices)=yy_test;

pdf=nan(length(time),length(por_range));
pdf(train_indices,:)=pdf_train;
pdf(test_indices,:)=pdf_test;

imagesc(por_range,time,pdf);hold on;
colormap(summer);
caxis([0,5e-4])
% cb=colorbar;
% set(cb,'ytick',0:1,'yticklabel',{'low','high'});
% set(get(cb,'title'),'string','Probability');
plot(por,time,'linewidth',1.5,'color','k');hold on;
plot(por_train,time,'o','Markersize',3.0,'Color','b','linewidth',1.5);hold on;
plot(por_test,time,'o','Markersize',3.0,'Color','r','linewidth',1.5);hold on;
set(gca,'ydir','reverse','layer','top','linewidth',1.5,'tickDir','out','box','on');
set(gca,'FontSize',15,'FontWeight','bold');
STR=sprintf('%s%d%s','W',numofblindwell,'-Porosity');
title(STR,'FontSize',18,'FontWeight','bold'); 
ylim([time(1),time(end)])
if numofblindwell==1 
    ylabel('Time (ms)','FontWeight','bold','FontSize',18); 
end


% figure(h2)
% subplot(1,7,numofblindwell)
% sd=nan(length(time),1);
% sd(train_indices)=sd_train;
% sd(test_indices)=sd_test;
% 
% h=imagesc([0,1],time,sd);
% set(h,'alphadata',~isnan(sd));
% colormap(flipud(hot));
% colorbar
% %caxis([0.0032,0.05]);; % 控制每口井的sd colorbar尺度一致
% set(gca,'linewidth',1.5,'xtick',[],'ytick',[],'box','on');
% set(gca,'FontSize',15,'FontWeight','bold');
% STR=sprintf('%s%d%s','W',numofblindwell,'-SD');
% title(STR,'FontSize',18,'FontWeight','bold');

