"stacked" polar plot
Afficher commentaires plus anciens
I have a time series of velocities (speed and direction). I would like to do a polar plot where:
• The radial distance from the center is the speed of a given time point
• The angle is the vector angle of that time point
That part is easy. But I would like to do histograms, with the data binned by radial distance (i.e., binned by speed), and by angle, with the color of the bin proportional to the number of points in that bin.
So the plot would potentially have multiple sectors at different radial bins within an angle range, and each sector would have a color given by the number of points in that sector/radial bin.
Basically, it would be doing a histogram of data in a regular polarplot of the data (individual points), but the histogram would be in radial/angular bins, with each bin colored by the number of points in that bin.
Note: this is NOT the same as the radial distance giving the frequency of occurrence of that angle (i.e. polarhistogram). I need the radial distance to be the speed (in bins, stacked with greater speeds being at larger radii).
Thanks for your help!
3 commentaires
Peter Franks
le 25 Mai 2023
Déplacé(e) : Star Strider
le 25 Mai 2023
Cris LaPierre
le 25 Mai 2023
Can you share your data as well as the code you have written? It is much easier if you provide something to work with.
Peter Franks
le 25 Mai 2023
Modifié(e) : Peter Franks
le 25 Mai 2023
Réponses (1)
Adeline
le 18 Août 2023
I understand that you are trying to plot a wind rose diagram with your data of speed and angle. You want the data to be binned by speed but color coded by frequency. Using the windrose function referenced in the comments, you can bin the data by speed. Since the data is binned by speed in this function, you can color code them only based on speed.
The following example illustrates the above description:
speed = randi(25,1,1000);
vangle=randi(360,1,1000);
wind_rose(vangle,speed);

Note: If radius is speed and the bin is color coded by frequency (i.e., the number of points in a each speed bin) then the chart would look like a multi-level pie chart as shown below. This cannot be achieved using a polar histogram. As the histogram plot would require one axis to be defined by the number of points in the bins.

3 commentaires
Peter Franks
le 18 Août 2023
Saurav
le 3 Jan 2024
Hi, I am also stuck in the situation same as Peter. Could you tell me which function/ code you used in order to get the plot as this?

And if possible, could you please tell me if you could plot the probability of the data instead of the count?
Thank you.
Walter Roberson
le 3 Jan 2024
I believe they are using https://www.mathworks.com/matlabcentral/fileexchange/65174-wind_rose-wind_direction-wind_speed
Catégories
En savoir plus sur Polar Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
