Я пытаюсь создать фигуру с двумя розами ветров рядом, но она возвращает мне KeyError: 'theta_labels'
в строке 18.
Вот мой код:
import matplotlib.pyplot as plt
import numpy as np
import windrose
#### ----------------
def set_legend(ax):
l = ax.legend(loc="center right",borderaxespad=-1)
# l.get_frame().set_fill(False) #transparent legend
plt.setp(l.get_texts(), fontsize=10,weight='bold')
fig=plt.figure(figsize=(15,15))
left_rectangle = [0, 0.1, 0.4, 0.75] #[left, bottom, width, height] as a fraction of total figure size
right_rectangle = [0.5, 0.1, 0.4, 0.75] #[left, bottom, width, height] as a fraction of total figure size
ax1 = WindroseAxes(fig, left_rectangle)
ax2 = WindroseAxes(fig, right_rectangle)
fig.add_axes(ax1)
ax1.bar(DIRECTIONDATA1,DATA1, normed=True, opening=0.6, bins = np.arange(0, 6, 1),edgecolor='grey', nsector=8, cmap=cm.viridis_r)
ax1.grid(True,linewidth=1.5,linestyle='dotted')
set_legend(ax1)
fig.add_axes(ax2)
ax2.bar(np.array(DIRECTIONDATA2),np.array(DATA2), normed=True, opening=0.6, bins = np.arange(0, 6, 1),edgecolor='grey', nsector=8, cmap=cm.viridis_r)
ax2.grid(True,linewidth=1.5,linestyle='dotted')
set_legend(ax2)
Я использую следующую розу ветров: https://github.com/python-windrose/windrose/tree/master/windrose