Can Matlab generate this plot?

I have data series A, B, C, D and E.
Each one has a series of multiple angles for example data A has 15 members that ranges between +30 and -30 degree as you can see from the image.
Can matlab generate above plot so that you can visualize the series of all A to E? The dark color shows more concentrated angles (or mean) and as it goes to borders the color become week.
Thanks for your suggestions.

回答 (1 件)

Jon
Jon 2020 年 2 月 24 日
編集済み: Jon 2020 年 2 月 24 日

1 投票

Something like this example should get you close:
% make a matrix of data just to demonstrate, you would use your own data here
theta = (randn(100,5)*15 + [-10 20 5 0 30])*pi/180; % angle in radians
% set the radius you want each band set to, here the nominal radius is 1
% and I go equally space +/- from 1-0.2 to 1+0.2 in 5 steps (number of bands)
rho = ones(100,5) + linspace(-0.2,0.2,5)
% plot the results,
% you could experiment with different symbols, maybe '.' would be nicer
polarplot(theta,rho,'*')

4 件のコメント

Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020 年 2 月 25 日
編集済み: Zeynab Mousavikhamene 2020 年 2 月 25 日
Thank you. Any idea to have gradient color instead of fix color to show the aggregation of data like the median of dat by darker color like the above image?
Jon
Jon 2020 年 2 月 25 日
The simplest idea, if you have lots of data, would be to plot smaller data points for example use the '.' marker instead of the 'o' marker. If you have enough data, just the density of the points near the median, would make the plot appear darker.
Otherwise, for each band, you could find the indices of the points that are within say the +/- 25 quartile, and then plot those with a darker color.
Note you can specify the color as a RGB triplet with for example
Type doc polarplot on command line for documentation on polarplot
polarplot(theta,rho,'.','Color',[0.3 0.8 0.6])
darova
darova 2020 年 2 月 25 日
Jon
Jon 2020 年 2 月 25 日
@darova's suggestion is a good one if you truly need to have gradient filled, outlined boxes as in your picture, but it might be a little more involved than the simple polarplot using points that I outlined.
There are alot of related answers using the patch approach for example:
You can find more if you search in MATLAB answers with the terms polar patch

サインインしてコメントする。

カテゴリ

質問済み:

2020 年 2 月 24 日

コメント済み:

Jon
2020 年 2 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by