How to create a symmetric histogram
古いコメントを表示
Hello,
I have data vector A, which includes some angular values between 0 and 180 degrees.
I have the desire to get a symmetric histogram. Therefore I create an extra vector B, which is 180-vector A, so that the sum of vector of A and B is 180 degrees.
However, When I plot the Vector C which is C = [A;B]; it does not give me the desired resulted.
Any thoughts?
採用された回答
その他の回答 (1 件)
Sayyed Ahmad
2019 年 2 月 26 日
du you means this?
A=linspace(0,pi,181);
X=sin(A);
Y=-X
plot(A,X,'r-',A,Y,'b-')
5 件のコメント
Lukos
2019 年 2 月 26 日
Steven Lord
2019 年 2 月 26 日
What function are you using to "plot the histogram of this vector"? If you're using histogram, are you specifying symmetric BinEdges?
Lukos
2019 年 2 月 26 日
Steven Lord
2019 年 2 月 26 日
x = randn(1, 100);
data = [x, -x];
h = histogram(data, -3:0.5:3);
That looks like a pretty symmetric histogram to me. Use this same technique for your data.
Lukos
2019 年 2 月 26 日
カテゴリ
ヘルプ センター および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!