How to plot this frequency graph?

Dear all,
I have runoff and precipitation data (as I attached), how I can achieve such a plot?
I tried this script:
histogram2(precipitation,runoff,'Normalization','count')
But it seems wrong and the range of x and y lines doesn't set between 0 to 1. The name of this plot below is bivariate frequency graph which is a histogram of precipitation and runoff.
Thank you in advance

2 件のコメント

Ive J
Ive J 2021 年 10 月 10 日
Do you mean something like this?
pn = normalize(precipitation, 'range');
rn = normalize(runoff, 'range');
histogram2(rn, pn)
BN
BN 2021 年 10 月 10 日
Yes, Thank you, and why do I have blank mosaics in the plot? is there any way to force it to show zero values, instead of leaving them blank? thank you

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

 採用された回答

Chunru
Chunru 2021 年 10 月 10 日
編集済み: Chunru 2021 年 10 月 10 日

1 投票

load runoff
load precipitation
precipitation = normalize(precipitation, 'range');
runoff = normalize(runoff, 'range');
histogram2(runoff, precipitation, 'Normalization', 'pdf', 'ShowEmptyBins','on'); % for probability density function

1 件のコメント

BN
BN 2021 年 10 月 10 日
Thank you so much

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2021a

質問済み:

BN
2021 年 10 月 9 日

コメント済み:

BN
2021 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by