Shade between lines in log-y scale not properly plot

1 次查看(过去 30 天)
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