I am new to Python and am attempting to create a wind rose using the windrose.py
code found at this website: http://sourceforge.net/projects/windrose/
The following is the code I am running and I found the example code at the following website: http://youarealegend.blogspot.com/search/label/windrose
import numpy
from windrose import WindroseAxes
from matplotlib import pyplot as plt
import matplotlib.cm as cm
from numpy.random import random
from numpy import arange
import windrose as wr
import matplotlib.pyplot as mp
import windrose
#Create wind speed and direction variables
ws = random(500)*6
wd = random(500)*360
#A quick way to create new windrose axes...
def new_axes():
fig = plt.figure(figsize=(8, 8), dpi=80, facecolor='w', edgecolor='w')
rect = [0.1, 0.1, 0.8, 0.8]
ax = WindroseAxes(fig, rect, axisbg='w')
fig.add_axes(ax)
return ax
#...and adjust the legend box
def set_legend(ax):
l = ax.legend(axespad=-0.10)
plt.setp(l.get_texts(), fontsize=8)
wr.wrcontourf(wd, ws)
When I run this code, I get the following error:
RuntimeWarning: invalid value encountered in rint
return round(decimals, out)
TypeError: __init__() got an unexpected keyword argument 'axespad'
Although I've tried a number of things I can't figure out what the axespad variable is doing in this code. Any advice would help!