1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > python画玫瑰图_python windrose(风玫瑰图)

python画玫瑰图_python windrose(风玫瑰图)

时间:2019-06-27 17:47:34

相关推荐

python画玫瑰图_python windrose(风玫瑰图)

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:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。