I want to plot 3 or more data using the probability of the histogram.

조회 수: 1 (최근 30일)
Seong Keun Kim
Seong Keun Kim 2022년 1월 22일
댓글: Ahmed raafat 2022년 1월 22일
I entered the code as below to display the data.
I want to represent the 3 data as separate bars. However, the graphs are displayed "overlapped".
What function should I use to display 3 3 data sets as separate bars in one figure? (More specifically, I want to represent the three data as non-overlapping bars in different colors.)
----------------------------------------------------------------
filename=[path 'histogram.xlsx'];
sheet=1;
xlrange='B5:D10000';
x=xlsread(filename,sheet,xlrange);
x=histogram(x,'Normalization','probability')
x.BinWidth = 0.005;
xlim([0 0.5]);

답변 (1개)

Ahmed raafat
Ahmed raafat 2022년 1월 22일
first you can try like this example
x=rand(1000,3)
hist(x)
or you can use subplot
  댓글 수: 2
Seong Keun Kim
Seong Keun Kim 2022년 1월 22일
This example cannot use probability. Is probability applicable to hist(x) function?
Ahmed raafat
Ahmed raafat 2022년 1월 22일
hist is like histogram command

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by