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 CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by