plotting 2 different sized data into histogram

3 ビュー (過去 30 日間)
Bhagyesh Shiyani
Bhagyesh Shiyani 2019 年 11 月 28 日
コメント済み: Luna 2019 年 12 月 2 日
hello,
i have 2 data files, like R1(6400*1) and R2(6500*1). data inside both are varying between 0 to 3 but R2 contains 20 data with value varying between3 to 12.
how while plotting the histogram of both data together, bar of the both R! and R2 are of different width. suppose i have bar of 0.2-0.4 of R1 then i am getting bar of R2 range 0.2-0.35 so next bar of R2(0.35-....) is also over lapping with R1(0.2-0.4) range with is very hard to compare both data.
i tried with setting nbins but due to varing data of both matrix overlapping is still a problem and hard to compare it.
please anyone suggest me the solution to manage both bars of same width.
here is the picture with program line 97,98 and 107,108. where nbins is 1 for every bars.problem.JPG
  2 件のコメント
Luna
Luna 2019 年 11 月 28 日
Can you provide a visual?
Bhagyesh Shiyani
Bhagyesh Shiyani 2019 年 11 月 28 日
please check it.

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

採用された回答

Luna
Luna 2019 年 11 月 28 日
Try this for your both histograms. Do not use nbins.
widthvalue = 0.1;
histogram(X,'BinWidth',widthvalue)
  2 件のコメント
Bhagyesh Shiyani
Bhagyesh Shiyani 2019 年 12 月 1 日
thank you very much. i usd linewidth for my program and it worked.
Luna
Luna 2019 年 12 月 2 日
Your welcome :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by