How to plot something like this plot?

3 visualizaciones (últimos 30 días)
BN
BN el 19 de Abr. de 2020
Comentada: BN el 21 de Abr. de 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

Respuesta aceptada

Adam Danz
Adam Danz el 19 de Abr. de 2020
Editada: Adam Danz el 19 de Abr. de 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 comentario
BN
BN el 21 de Abr. de 2020
I really appreciate you. It was quite helpful.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Polar Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by