shaded confidence interval plotting with shade area (patch)
이전 댓글 표시
Hello,
I'm trying to plot the shadow area between the confidence interval with the line in the middle. I've tried a few approaches, but each time I'm getting the same results (plot image). I've attached a data and code below. Please help, I don't know why I have this problem. I've read similar tags, and tried to adhere to the solutions, but it seems that doesn't work for my case.
% Using Matlab - calculations of confidence interval
pd = fitdist(X,'Normal')
ci = paramci(pd)
a4=ci(1,1)/pd.mu;
b4=ci(2,1)/pd.mu;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
x=X.*a4;
y=X.*b4;
Ymax=y;
Ymin=x;
figure
plot(time,Ymax)
hold on
plot(time,Ymin)
line([time(end) time(end)],[Ymin(end),Ymax(end)])
line([time(2) time(2)],[Ymin(1),Ymax(1)])
patch([time fliplr(time)], [Ymax fliplr(Ymin)], 'g')
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
