0

Is there a way to add windrose in subplots without adding them one by one. For example if I create a figure with 4 subplots

import matplotlib.pyplot as plt
fig,ax = plt.subplots(2,2)

How can I add a windrose to ax[0,0] For an example data, I have tried the following

wind_dir = np.array([30,45,90,43,180])
wind_sd = np.arange(1,wind_dir.shape[0]+1)
bins_range = np.arange(1,6,1)

fig,ax = plt.subplots(2,2)
wax = WindroseAxes.from_ax(fig =fig, ax = ax[0,0])
wax.bar(wind_dir, wind_sd,normed=True,bins=bins_range)

However, this throws an error AttributeError: Unknown property normed

Vinod Kumar
  • 1,383
  • 1
  • 12
  • 26
  • Method "b" in the answer seems like a workaround for now! I would be happier with something like what we do for polar graphs in subplots, e.g. we provide fig,ax = plt.subplots(2,2,subplot_kw=dict(polar=True)) – Vinod Kumar Dec 16 '19 at 14:36
  • The main problem is that `from_ax` suggests that you could pass in an axes and get a windrose axes at the same position out. This is not the case. So the `ax` argument is totally useless as it stands. Workarounds are shown in the duplicate. – ImportanceOfBeingErnest Dec 16 '19 at 14:39
  • note that you can do: `plt.subplots(2, 2, subplot_kw={"projection": "windrose"})` – Sam Mason Dec 16 '19 at 14:41
  • Indeed I can do that. However, this is of no use as I can not add a windrose to these subplots with windrose projections. – Vinod Kumar Dec 16 '19 at 14:45

0 Answers0