conda
install -c /conda-forge
windrose
(b)用pip install windrose可以成功,但是安装的路径,python找不到,from windrose import
WindroseAxes 不成功。
需要在程序中指定路径(这个路径在执行pip的时候能给出):
import
imp
foo =
imp.load_source('windrose',
'/Users/xuehaile/anaconda/lib/python2.7/site-packages/windrose/windrose.py')
from
windrose import WindroseAxes
2.
画子图(subplots)的时候,网上提示用
fig=plt.figure()
ax =
fig.add_subplot(2, 1, 1,projection='windrose')
ax =
fig.add_subplot(2, 1, 2,projection='windrose')
但是python运行不能识别projection。这需要修改windrose.py源程序
如下
register the WindroseAxes as
a projection into matplotlib. To this end, you need to edit the
file windrose.py in the site-packages/windrose as follows:
Include an import from
matplotlib.projections import
register_projection at the beginning of the
file.
Then add a name variable :
classWindroseAxes(PolarAxes):name='windrose'...
Finally, at the end of windrose.py, you add:
register_projection(WindroseAxes)
Once that is done, you can easily create your windrose axes using
the projection argument to the matplotlib axes: