我正在尝试使用相同位置的风速和阵风速度测量值来可视化风之间的关系。为此,我使用windrose脚本。
让数字看起来正确没问题,但我对传说有很多问题。似乎一个颜色图占主导地位,只是覆盖了另一个。名为“Gust Speed [m/s]”的图例实际上应该遵循名为 Summer 的颜色图,它没有红色调。
这是代码的一部分,用于查看我如何创建子图和图例。
f4 = fig.add_subplot(224, projection='windrose')
f4.set_title('Fall')
ws = f4.bar(df['Wind Direction'][df.index.month.isin([10,11])],
df['Wind Speed'][df.index.month.isin([10,11])],
normed=True,
bins=np.arange(0, 10, 1),
cmap=cm.autumn,
)
l1 = f4.legend(ws, title='Wind Speed [m/s]',
bbox_to_anchor=(1.3,0.9),
bbox_transform=fig.transFigure
)
gs = f4.contour(df['Wind Direction'][df.index.month.isin([10,11])],
df['Gusts Speed'][df.index.month.isin([10,11])],
normed=True,
alpha=1,
bins=np.arange(0, 25, 2.5),
cmap=cm.summer,
lw=1.5,
linestyle='--',
label='Wind Gusts',
)
# Legends
f4.legend(gs, title='Gust Speed [m/s]',
bbox_to_anchor=(1.3, 0.5),
bbox_transform=fig.transFigure
)
f4.add_artist(l1)
我该如何解决这些问题?是否有更好的方式来讲述传说,使用哪些情节来创建传说?