Azzera filtri
Azzera filtri

how to plot cdfplot with different line style?

92 visualizzazioni (ultimi 30 giorni)
Hydro
Hydro il 26 Mar 2017
Commentato: Ritayan Biswas il 6 Lug 2021
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.

Risposte (1)

Walter Roberson
Walter Roberson il 2 Mag 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 Commenti
Giuseppe Degan Di Dieco
Giuseppe Degan Di Dieco il 17 Apr 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
Ritayan Biswas il 6 Lug 2021
Hi Walter,
Thank you for your answer, it really helped me set-up my CDF plot.
Regards :)

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by