I posted another question a little while ago, but have since tried a different technique for plotting the windrose pollution rose. I am, however, still having issues with it. I found the template for this technique from this post I'm not sure where I am going wrong with the instructions, and am getting a weird looking plot.
Any help with where I'm going wrong would be greatly appreciated!
Here's the code:
wd = list(merge_all_apr['Wind Dir (10s deg)'])
conc = list(merge_all_apr['Mean_CO2'])
ws = list(merge_all_apr['Wind Spd (km/h)'])
wd_rad = np.radians(np.array(wd))
wind_dir, wind_speed = np.meshgrid(wd_rad, ws)
C = np.sinc(wind_dir-2)+(5-np.sqrt(wind_speed))+conc
C = np.ma.masked_less_equal(C,2)
fig, ax = plt.subplots(figsize=(20, 10), subplot_kw={"projection": "polar"})
cmap = plt.get_cmap('jet')
img = ax.pcolormesh(wind_dir, wind_speed, C, cmap=cmap, vmin=0, vmax=20, alpha = 0.70)
ax.set_theta_zero_location('N')
ax.set_theta_direction(-1)
ax.set_ylim(0,50)
ax.set_yticks(np.arange(0,50,5))
#move yticks to different radial position
ax.set_rlabel_position(40)
plt.colorbar(img)
plt.show()