Shade between lines in log-y scale not properly plot

1 vue (au cours des 30 derniers jours)
Albert Johan Mamani Larico
Réponse apportée : Chunru le 24 Mai 2022
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')

Réponse acceptée

Chunru
Chunru le 24 Mai 2022
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')

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Mobile Fundamentals dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by