Very simple code to plot a wind rose. Pass it wind direct and wind speed and it will produce a simple wind rose. Note only designed for up to 25m/s but can easily be hacked to add more wind speed.
Al Mac (2021). wind_rose(wind_direction,wind_speed) (https://www.mathworks.com/matlabcentral/fileexchange/65174-wind_rose-wind_direction-wind_speed), MATLAB Central File Exchange. Retrieved .
Hi Maria, it is a very basic bit of script, I think it could be to do with your data being in a table. When I wrote it I passed it wind_direction (in degrees) and wind_speed (in m/s) as arrays. They are (n x 1) in size. n being the number of data points. if T is your table then maybe try wind_speed = table2array(T(:,1)); and wind_direction = table2array(T(:,2));, or however you table is formatted. Then run the function as wind_rose(wind_direction,wind_speed).
What is the best way to feed the data to the plot? I have used the "readtable" function from a .txt file with WindDirection and WindSpeed as two separate columns. However, it seems like there is a problem using the data... All i get is an empty plot.
I appreciate any help! :)
really simple and easy.
How do I keep the legend and wind rose colors the same? Every time I change them, the other is slightly different.
Dear Mac, could you give a hint how to implement your code in AppDesigner? Thank you very much!
How can i keep same color in legend and graph fils?
It changes the color
It seems that Face.Alpha changes the color
Thank you for this!
About Matlab Release Compatibility: this function is not compatible with previous versions to R2016a. Since this version, the function "polaraxes" was added to Matlab. : )
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!