Creating a polar histogram with x values (bins) that will appear on the graph even though no values fall into those bins?
조회 수: 7 (최근 30일)
이전 댓글 표시
I am trying to make a polar histogram of values that actually are measured angles of axons exiting a brain structure (they are all measured in 2D). Essentially, these angles are all roughly between 1-270 degrees, but there are no measurements between 270 & 360. I have attached a histogram made of the data. My goal is to essentially "wrap" this histogram around a circle, but since there are no values for the last 1/4 of the x values, I'm not sure how to tell MATLAB that "there needs to be an empty section on this histogram at the end."
Thank you!
댓글 수: 0
채택된 답변
Steven Lord
2023년 5월 31일
x = deg2rad(randi([0 270], 1, 1e6));
polarhistogram(x);
If not, just call histogram with a vector of bin edges and/or specifying the BinLimits name-value argument.
x = rand(1, 1e6);
h = histogram(x, 0:0.25:2);
h.BinEdges.'
Even though there's no data greater than 1, because I specified the bin edges that's what histogram used.
figure
h = histogram(x, 'NumBins', 16, 'BinLimits', [0 2]);
h.BinEdges.'
16 equal width bins spanning from 0 to 2.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!