Dear users,
Below is a sample script I got from windrose pack. I would like to place 2 windroses side by side so that a comparison can be made. For example I have created additional variables ws1 wd1, and I would like that to be placed in the same row as a 1 row 2 column way. Any help in this regard will be great. (I tried subplot(221) subplot(222) but it do not work as the windrose uses new axis each time.)
from windrose import WindroseAxes
from matplotlib import pyplot as plt
import matplotlib.cm as cm
from numpy.random import random
from numpy import arange
#Create wind speed and direction variables
ws = random(500)*6
wd = random(500)*360
ws1 = random(500)*6
wd1 = random(500)*360
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
def set_legend(ax):
l = ax.legend(axespad=-0.10)
plt.setp(l.get_texts(), fontsize=8)
#windrose like a stacked histogram with normed (displayed in percent) results
ax = new_axes()
ax.bar(wd, ws, normed=True, opening=0.8, edgecolor='white')
set_legend(ax)
#Another stacked histogram representation, not normed, with bins limits
##print ax._info
plt.show()
···
***************************************************************
Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@...287...;sudheer.joseph@...9...
Web- http://oppamthadathil.tripod.com
***************************************************************