Shade between lines in log-y scale not properly plot

조회 수: 1 (최근 30일)
Albert Johan Mamani Larico
Albert Johan Mamani Larico 2022년 5월 24일
답변: Chunru 2022년 5월 24일
Hi, I have a similar issue, my filled area (figure 2) is not as expected, I don´t understand what's wrong. How could I fix it?
load data_ecdf
figure(1) % just to view the expected filled area
semilogy(eOut.psSST, eOut.sSST);grid on;ylabel('mg/L');hold on;title('SST')
semilogy(eOut1.psSST, eOut1.sSST);hold on
semilogy(eOut2.psSST, eOut2.sSST);
legend('empirical','down','up'); hold off
idx = eOut1.sSST>0 & eOut2.sSST>0; % Eliminate Negative & Zero Data
figure(2) % uncertainty band
fill([eOut1.psSST(idx) fliplr(eOut1.psSST(idx))], [eOut1.sSST(idx) fliplr(eOut2.sSST(idx))],[.9 .9 .9], 'linestyle','none')
line(eOut.psSST, eOut.sSST);grid on;ylabel('mg/L');xlabel('probability');title('SST')
set(gca,'YScale','log')

채택된 답변

Chunru
Chunru 2022년 5월 24일
load data_ecdf
figure(1) % just to view the expected filled area
semilogy(eOut.psSST, eOut.sSST);grid on;ylabel('mg/L');hold on;title('SST')
semilogy(eOut1.psSST, eOut1.sSST);hold on
semilogy(eOut2.psSST, eOut2.sSST);
legend('empirical','down','up'); hold off
idx1 = eOut1.sSST>0 ;
idx2 = eOut2.sSST>0; % Eliminate Negative & Zero Data
figure(2) % uncertainty band
semilogy(eOut.psSST, eOut.sSST); hold on
%eOut1.psSST(idx)
fill([eOut1.psSST(idx1); flip(eOut2.psSST(idx2))], [eOut1.sSST(idx1); flip(eOut2.sSST(idx2))],[.9 .9 .9], 'linestyle','none')
grid on;ylabel('mg/L');xlabel('probability');title('SST')
set(gca,'YScale','log')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Mobile Fundamentals에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by