how to plot cdfplot with different line style?

81 ビュー (過去 30 日間)
Hydro
Hydro 2017 年 3 月 26 日
コメント済み: Ritayan Biswas 2021 年 7 月 6 日
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 件のコメント
Amir.F
Amir.F 2017 年 5 月 2 日
I have the same problem

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 5 月 2 日
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 件のコメント
Giuseppe Degan Di Dieco
Giuseppe Degan Di Dieco 2021 年 4 月 17 日
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 2021 年 7 月 6 日
Hi Walter,
Thank you for your answer, it really helped me set-up my CDF plot.
Regards :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeExploration and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by