Reputation: 145
I am using the following code to add a patch (a Wedge) over a Wind rose...however the output also provided is not looking good... Would anyone have solution to my problem?
fov = Wedge((0,0), 20, 20, 60, color="r", alpha=0.5)
plt.hist([0, 1])
plt.close()
ax=WindroseAxes.from_ax()
ax.grid(linestyle="dashed", color="grey", zorder=0)
ax.bar(df_1995['dir'], df_1995['w_speed'],normed=True, opening=1, cmap = cm.magma_r, edgecolor='black', linewidth=0.5, bins=spd_bins, nsector=36, zorder= 3)
ax.set_legend(loc=(-0.12, 0.75), labels=spd_labels)
ax.set_yticks(np.arange(1, 12, step=3))
ax.set_yticklabels(np.arange(1, 12, step=3))
ax.set_title("Walney, Pre-farm Windrose")
ax.add_artist(fov)
plt.show()
Upvotes: 0
Views: 91
Reputation: 145
The solution to my problem involves to use the following argument when defining the Wedge patch: transform=ax.transAxes
Thus, the full code for defining the patch is:
fov = Wedge((0.51,0.43), 0.497, 220, 260, lw=1.5, facecolor="grey", edgecolor ='black', transform=ax.transAxes, alpha=0.2)
Upvotes: 0