my wind rose diagram going out of the subplot
from windrose import WindroseAxes
fig=plt.figure()
plot1 = plt.subplot2grid((4, 6), (0, 0), rowspan=2, colspan=2)
plot2 = plt.subplot2grid((4, 6), (2, 0), rowspan=2, colspan=2)
plot3 = plt.subplot2grid((4, 6), (0, 2), rowspan=4, colspan=4)
plot1.plot([1,2,3,4],[3,2,5,6])
plot2.scatter([1,3,5,7],[2,7,3,1])
rect = [1, 1, 2, 2]
wa = WindroseAxes(fig, rect)
fig.add_axes(wa)
wa.bar(wd, ws, normed=True, opening=0.8, edgecolor='white')
final result is this. but i need all three graphs in single figure
I am trying to plot all the 3 graphs in a single figure but I got my wind rose graph out of the figure
Following the example from github, in
plt.subplot2grid()and similar functions, you need to setprojection='windrose'. You should removewa = WindroseAxes(fig, rect)andfig.add_axes(wa). At the end of the codeplt.tight_layout()seems to work, it moves the subplots a bit to avoid overlapping labels.Here is the updated example (also renaming
plot1toax1, to be more consistent with the matplotlib documentation).