How to plot multiple polar graph?

60 vues (au cours des 30 derniers jours)
Saad
Saad le 24 Avr 2012
Commenté : yonatan yamin le 21 Avr 2022
How can I plot multiple polar diagram in one graph?
  1 commentaire
Chris
Chris le 16 Mar 2015
Why don't the axes handles work ? I have R2013a, and the docs say you get a handle from polar, and can pass this as the first parameter
K>> h = polar (t(1:5),r(1:5), '-*')
h =
1.8470e+03
K>> polar (h,t(6:end),r(6:end), '-O') Error using polar (line 23) Too many input arguments.

Connectez-vous pour commenter.

Réponse acceptée

Davide Ferraro
Davide Ferraro le 24 Avr 2012
The HOLD command should work:
t = 0:.01:2*pi;
polar(t,cos(2*t).*cos(2*t),'--k')
hold on
polar(t,sin(2*t).*cos(2*t),'--r')
  3 commentaires
Saad
Saad le 26 Avr 2012
Thanks :)
yonatan yamin
yonatan yamin le 21 Avr 2022
thanks it was very helpfull

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 24 Avr 2012
Probably the easiest way is to plot each of the diagrams on its own axes, and then use copyobj() to copy them on to one common axes.
polar() is implemented as creating a circular patch() object to hold the diagram, drawing in the spokes and discs, using text() to add labels, and using pol2cart() to convert the polar coordinates to cartesian coordinates for the purpose of drawing the graph itself.
polar() detects that presence of the patch() object and will not draw it again if it is present there. This is why you need to draw on different axes in order to be able to end up with multiple diagrams.
After you copyobj() you will need to offset all of the coordinates of all of the graphics objects so that they do not overlap. This will be a bit tricky as text() objects will only accept data coordinates, not pixel coordinates.
Also note that polar() creates two axes.
I would suggest that you might want to consider using subplot() instead of having multiple diagrams on the same graph.
  1 commentaire
Saad
Saad le 26 Avr 2012
Thanks :)

Connectez-vous pour commenter.

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by