normalize hist3 plot

조회 수: 18 (최근 30일)
Fernando
Fernando 2019년 7월 11일
댓글: Fernando 2019년 7월 11일
Is it possible to normalize a hist3 plot so the vertical axis does not have counts but rather probabilities so the volume under the surface integrates to 1? For example,
X = sortrows(randi(10,100,2));
hist3(X)
results in a bivariate histogram of the columns of X but the vertical axis is counting the number of times each combination occurs. Instead, is it possible to change the vertical axis so it represents the fraction of times a combination occurs?
Thanks.

채택된 답변

Steven Lord
Steven Lord 2019년 7월 11일
Use histogram2 instead of hist3. As stated in the "Alternative Functionality" section of the hist3 documentation page, histogram2 allows you to specify the 'Normalization' parameter.
  댓글 수: 1
Fernando
Fernando 2019년 7월 11일
Thanks!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by