How to make the y axis 'counts' and x axis the variable on Histograms
조회 수: 46 (최근 30일)
이전 댓글 표시
How to make the y axis 'counts' and x axis the variable on Histograms? The default is to have counts on the x axis and I want them on the y
댓글 수: 3
Adam Danz
2020년 12월 3일
The statement in your question, "The default is to have counts on the x axis and I want them on the y" is incorrect. The y-axis in histograms typically represents counts, frequencies, percentages, or other statistics about the data within each bin. The x-axis represents the bins for whatever variable you're plotting (weight, height, age, etc).
> all that happens is I have relabled my axis to represent the wrong thing
You'll have to explain your goal and your interpretation of the axes more clearly.
답변 (2개)
Ameer Hamza
2020년 12월 3일
편집: Ameer Hamza
2020년 12월 3일
One option is to just rotate the view
x = rand(1000,1);
histogram(x)
view(90, 90)
Combining histcounts() with barh() is another option.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!