function curveswithuncertainty(numofblindwell,time,y_train,yy_train,sd_train,train_indices,y_test,yy_test,sd_test,test_indices,h2,h3)

% python和matlab索引差1
train_indices=train_indices+1;
test_indices=test_indices+1;

if numofblindwell<=3
    figure(h2)
else
    figure(h3)
end

if numofblindwell<=3
    subplot(1,7,2*numofblindwell-1);
else
    subplot(1,7,2*(numofblindwell-3)-1);
end

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;

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;
if numofblindwell==1
    legend('Real','Training','Test');
end

% c=nan(length(time),1);
% c(train_indices,:)=0;
% c(test_indices,:)=1;
% por_pred=nan(length(time),1);
% por_pred(train_indices,:)=yy_train;
% por_pred(test_indices,:)=yy_test;
% patch([por_pred;nan],[time;nan],[c;nan],'linewidth',1.5,'EdgeColor','interp');
% colormap([0.03 0.18 0.33;0.6350 0.0780 0.1840]);

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

if numofblindwell<=3
    subplot(1,7,2*numofblindwell);
else
    subplot(1,7,2*(numofblindwell-3));
end

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));
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');

