Is there a way to use polarhistogram together with compass?

1 visualización (últimos 30 días)
Pascal Geschwill
Pascal Geschwill el 31 de Dic. de 2016
Comentada: Pascal Geschwill el 4 de En. de 2017
Hi guys,
I have a vector of angles given in radians whose distribution I would like to visualize using polarhistogram. Additionally I want to show the mean of these angles in red using the compass function in the same plot. This is where I run into trouble since these two functions produce polar and cartesian axes, respectively which apparently are not compatible.
I can work around this by using the rose function instead of polarhistogram but there are far less formatting options included. Would anyone of you have an idea how to solve this problem?
Thanks in advance

Respuestas (1)

Vishal Neelagiri
Vishal Neelagiri el 3 de En. de 2017
You can extract the handle of the line object used to create the 'rose' plot and then use the line formatting properties to modify the plot. For example:
theta = [0.4 1.4 3.1 2.3 0.4 2.5 3.9 2.8 2.3 1.6 4.6 4.5 6.1 3.9 5.1];
h = rose(theta,10)
h.LineWidth = 2;
You can refer to the following documentation link for various line formatting properties:
https://www.mathworks.com/help/matlab/ref/chartline-properties.html
  1 comentario
Pascal Geschwill
Pascal Geschwill el 4 de En. de 2017
Hi Vishal,
thank you for your help. I'll give that a try. I worked around my problem in the meantime by plotting a line in polar coordinates indicating the mean angle. It doesn't look as nice as an arrow but this is just aesthetics at that point.

Iniciar sesión para comentar.

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by