How to plot something like this plot?

3 vues (au cours des 30 derniers jours)
BN
BN le 19 Avr 2020
Commenté : BN le 21 Avr 2020
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

Réponse acceptée

Adam Danz
Adam Danz le 19 Avr 2020
Modifié(e) : Adam Danz le 19 Avr 2020
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 commentaire
BN
BN le 21 Avr 2020
I really appreciate you. It was quite helpful.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by