How to plot something like this plot?

3 ビュー (過去 30 日間)
BN
BN 2020 年 4 月 19 日
コメント済み: BN 2020 年 4 月 21 日
Hello
I want to show the following data:
Jan = 5
Feb = 10
March = 5
April = 1
May = 14
June = 12
July = 0
August = 3
September = 5
October = 7
November = 10
December = 16
Winter = 15
Spring = 12
Summer = 3
Autumn = 1
Annual = 6
Here is an example plot that I need that I found from the Internet: (green line and black lines, not blue and violet liens because it seems it was plotted for 3 data sets)
I searched a lot but found not so much, I see there a function named on the polar plot but I don't know how to plot something like this using it. So maybe there is a better function than a polar plot exists for plotting my data in this way.
I want to ask you If you please tell me how can I do to plot my data like this.
Thank you so much

採用された回答

Adam Danz
Adam Danz 2020 年 4 月 19 日
編集済み: Adam Danz 2020 年 4 月 19 日
Here's a demo. I've chosen to use radians but you can use degrees with a few changes.
See inline comments for detail.
% For 12 months, compute 13 equally spaced angles where the
% first and last values will wrap to the same value.
theta = linspace(0,2*pi,13); % 12 equally spaced angles (13 points)
% Vector of radii values
r = randi(15,1,12); % 12 radii values
% Get month name abbreviations
monthNames = month(datetime(1, 1:12, 1), 's');
% Create polar plot
ax = polaraxes();
polarplot(ax, theta, r([1:end,1]), 'g-', 'LineWidth', 2)
% Set the polar axes units to radians, define the theta ticks
% and theta labels.
set(ax, 'ThetaAxisUnits', 'radians', 'ThetaTick', theta(1:end-1),...
'ThetaTickLabel', monthNames)
You can make further changes to the plot as needed suchs as putting January on top and making dotted reference lines. See polaraxes properties.
  1 件のコメント
BN
BN 2020 年 4 月 21 日
I really appreciate you. It was quite helpful.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by