Commit de42fe8a authored by git's avatar git

Replace graphe.py

parent 13da8432
......@@ -142,36 +142,45 @@ def graphiqueA(periode,Data):
Minp=Data[16][0]
Maxp=Data[17][0]
f, axarr = plt.subplots(2, sharex=True,figsize=(8,4), facecolor='#FFFFC8')
plt.xticks(fontsize = 9)
axarr[0],axarr_a=plt.subplots(figsize=(8,2), facecolor='#FFFFC8')
plt.xticks(fontsize = 9)
axarr_a.set_title('Température et point de rosée')
f, axarr = plt.subplots(2, sharex=True,figsize=(8,4), facecolor='#333333')
plt.xticks(fontsize = 8, rotation=15)
axarr[0],axarr_a=plt.subplots(figsize=(8,2), facecolor='#333333')
plt.xticks(fontsize = 8, rotation=15)
axarr_a.set_title('Température et point de rosée',color='w')
axarr_a.plot(X, Z,color='palegreen',alpha=0.5)
axarr_a.grid(True)
axarr_a.tick_params('°C', colors='#F0FFF0')
axarr_a.set_ylabel('Point de rosée (°C)', color='g')
axarr_a.tick_params(color='w')
axarr_a.set_ylabel('Point de rosée (°C)', color='palegreen')
axarr_a.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_a.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'palegreen', pad = 5,labelcolor = 'palegreen', labelsize = 10)
axarr_b=axarr_a.twinx()
axarr_b.plot(X,Y,color='r',linewidth='1.5',alpha=0.5)
axarr_b.set_ylabel('Température (°C)', color='r')
axarr_b.tick_params('°C', colors='r')
axarr_b.tick_params(color='w')
axarr_b.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_b.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'red', pad = 5,labelcolor = 'r', labelsize = 10)
axarr[0].tight_layout()
plt.savefig('a.png', facecolor='#FFFFC8',dpi=96)
axarr[1],axarr_c=plt.subplots(figsize=(8,2), facecolor='#FFFFC8')
plt.xticks(fontsize = 9)
axarr_c.set_title('Pluie et Pluie Cumulée')
plt.savefig('a.png', facecolor='#333333',dpi=96)
axarr[1],axarr_c=plt.subplots(figsize=(8,2), facecolor='#333333')
plt.xticks(fontsize = 8, rotation=15)
axarr_c.set_title('Pluie et Pluie Cumulée',color='w')
axarr_c.grid(True)
axarr_c.plot(X,U,color='b', linewidth='1',alpha=0.4)
axarr_c.set_ylabel('Cumul Pluie (mm)', color='b')
axarr_c.tick_params('mm', colors='b')
axarr_c.plot(X,U,color='cyan', linewidth='1',alpha=0.4)
axarr_c.set_ylabel('Cumul Pluie (mm)', color='cyan')
axarr_c.tick_params('mm', colors='cyan')
axarr_c.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_c.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'cyan', pad = 5,labelcolor = 'cyan', labelsize = 10)
axarr_c.fill_between(X,U, facecolor='#DFF2FF',alpha=0.4)
axarr_d=axarr_c.twinx()
axarr_d.plot(X,T,color='m', linewidth='2',alpha=0.4)
axarr_d.fill_between(X,T, facecolor='m',alpha=0.4)
axarr_d.set_ylabel('Pluie (mm)', color='m')
axarr_d.tick_params('mm', colors='m')
axarr_d.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_d.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'm', pad = 5,labelcolor = 'm', labelsize = 10)
axarr[1].tight_layout()
plt.savefig('b.png', facecolor='#FFFFC8',dpi=96)
plt.savefig('b.png', facecolor='#333333',dpi=96)
list_im = ['a.png','b.png']
imgs = [ PIL.Image.open(i) for i in list_im ]
min_shape = sorted( [(np.sum(i.size), i.size ) for i in imgs])[0][1]
......@@ -231,7 +240,7 @@ def graphiqueC(periode,Data):
'SO','SSO', 'S', 'SSE','SE','ESE']
values=P
matplotlib.rc('axes', facecolor = 'white')
fig = plt.figure(figsize=(5,4.5), facecolor='#FFFFC8')
fig = plt.figure(figsize=(5,4.5), facecolor='#333333')
axes = plt.subplot(111, polar=True)
t = np.arange(0,2*np.pi,2*np.pi/len(properties))
plt.xticks(t, [])
......@@ -255,9 +264,9 @@ def graphiqueC(periode,Data):
angle_deg = i/float(len(properties))*360
ha = "right"
if angle_rad < np.pi/2 or angle_rad > 3*np.pi/2: ha = "left"
plt.text(angle_rad, 10.75, properties[i], size=14,
horizontalalignment=ha, verticalalignment="center")
plt.savefig(Cname, facecolor='#FFFFC8',dpi=96)
plt.text(angle_rad, 10.75, properties[i], size=16,
horizontalalignment=ha, verticalalignment="center",color='white')
plt.savefig(Cname, facecolor='#333333',dpi=96)
def graphiqueB(periode,Data):
......@@ -298,37 +307,45 @@ def graphiqueB(periode,Data):
Maxp=Data[11][0]
Minh=Data[12][0]
Maxh=Data[13][0]
f, axarr = plt.subplots(2, sharex=True,figsize=(8,4), facecolor='#FFFFC8')
plt.xticks(fontsize = 9)
axarr[0],axarr_a=plt.subplots(figsize=(8,2), facecolor='#FFFFC8')
plt.xticks(fontsize = 9)
axarr_a.set_title('Humidité et Vent')
f, axarr = plt.subplots(2, sharex=True,figsize=(8,4), facecolor='#333333')
plt.xticks(fontsize = 8, rotation=15)
axarr[0],axarr_a=plt.subplots(figsize=(8,2), facecolor='#333333')
plt.xticks(fontsize = 8, rotation=15)
axarr_a.set_title('Humidité et Vent',color='w')
axarr_a.plot(X, Y,color='#F0FFF0',linewidth='1')
axarr_a.grid(True)
axarr_a.fill_between(X,Y, facecolor='#F0FFF0')
axarr_a.tick_params('%', colors='#F0FFF0')
axarr_a.set_ylabel('Humidité (%)', color='g')
axarr_a.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_a.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = '#F0FFF0', pad = 5,labelcolor = '#F0FFF0', labelsize = 10)
axarr_a.set_ylabel('Humidité (%)', color='#F0FFF0')
axarr_b=axarr_a.twinx()
axarr_b.plot(X,T,color='orange',linewidth='1', alpha=0.2)
axarr_b.fill_between(X,T, facecolor='orange', alpha=0.2)
axarr_b.set_ylabel('Vent (km/h)', color='orange')
axarr_b.tick_params('km/h', colors='orange')
axarr_b.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_b.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'orange', pad = 5,labelcolor = 'orange', labelsize = 10)
axarr[0].tight_layout()
plt.savefig('c.png', facecolor='#FFFFC8',dpi=96)
axarr[1],axarr_c=plt.subplots(figsize=(8,2), facecolor='#FFFFC8')
plt.xticks(fontsize = 9)
axarr_c.set_title('Pression et Pluie')
plt.savefig('c.png', facecolor='#333333',dpi=96)
axarr[1],axarr_c=plt.subplots(figsize=(8,2), facecolor='#333333')
plt.xticks(fontsize = 8, rotation=15)
axarr_c.set_title('Pression et Pluie',color='w')
axarr_c.grid(True)
axarr_c.plot(X,W,color='m', linewidth='1', alpha=0.3)
axarr_c.fill_between(X,W, facecolor='m', alpha=0.3)
axarr_c.set_ylabel('pluie (mm)', color='m')
axarr_c.tick_params('mm', colors='m')
axarr_c.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_c.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'm', pad = 5,labelcolor = 'm', labelsize = 10)
axarr_d=axarr_c.twinx()
axarr_d.plot(X,Z,color='r', linewidth='1')
axarr_d.set_ylabel('Pression (hpa)', color='r')
axarr_d.tick_params('r', colors='r')
axarr_d.xaxis.set_tick_params(labelcolor = 'white', labelsize = 9)
axarr_d.yaxis.set_tick_params(direction = 'out', length = 10, width = 1, color = 'r', pad = 5,labelcolor = 'r', labelsize = 10)
axarr[1].tight_layout()
plt.savefig('d.png', facecolor='#FFFFC8',dpi=96)
plt.savefig('d.png', facecolor='#333333',dpi=96)
list_im = ['c.png','d.png']
imgs = [ PIL.Image.open(i) for i in list_im ]
min_shape = sorted( [(np.sum(i.size), i.size ) for i in imgs])[0][1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment