how to plot cdfplot with different line style?
Afficher commentaires plus anciens
Hi all,
I am trying to compare observed streamflow versus simulated (coming from two models) data for the calibration and validation period. I need to assign a different line style and color to each set of data but should be consistent in both subplots.
I have written down this code but can't get the line style out of it (here is some random data)
Xobc=randn(1000,1);X1=randn(1000,1)+10; X2=randn(1000,1)*5;
Xobv=randn(500,1)*5; X3=randn(500,1)+2; X4=randn(500,1)*3;
figure
subplot(2,1,1);
hold on
cdfplot(Xobc); %Observed
cdfplot(X1); % Model-1
cdfplot(X2); % Model-2
set(gca, 'ylim', [0, 1.1])
title('Calibration')
subplot(2,1,2);
hold on
cdfplot(Xobv); %Observed
cdfplot(X3); % Model-1
cdfplot(X4); % Model-2
set(gca, 'ylim', [0, 1.1])
title('Validation')
xlabel('Streamflow (m^3/Sec)');
legend('Observed Streamflow','Model-1','Model-2');

I attached, my original data set plot as well. What would one get from the CDFplot at first place?? Is this a good comparison aside from the daily hydrographs? Any thoughts would be appreciated.
1 commentaire
Amir.F
le 2 Mai 2017
I have the same problem
Réponses (1)
Walter Roberson
le 2 Mai 2017
h(1, 1) = cdfplot(Xobc); %Observed
h(1, 2) = cdfplot(X1); % Model-1
h(1, 3) = cdfplot(X2); % Model-2
and
h(2,1) = cdfplot(Xobv); %Observed
h(2, 2) = cdfplot(X3); % Model-1
h(2, 3) = cdfplot(X4); % Model-2
and
set( h(:,1), 'LineStyle', '-', 'Color', 'b');
set( h(:,2), 'LineStyle', '.-', 'Color', 'g');
set( h(:,3), 'LineStyle', '--', 'Color', 'r');
2 commentaires
Giuseppe Degan Di Dieco
le 17 Avr 2021
Dear Walter,
thanks for your help.
It really helped me in setting my CDF plot.
May I ask you how did you find the solution?
Best.
Ritayan Biswas
le 6 Juil 2021
Hi Walter,
Thank you for your answer, it really helped me set-up my CDF plot.
Regards :)
Catégories
En savoir plus sur Triangular Distribution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!