You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x = numpy.array(range(20))
y = numpy.array([10,11,12,11,14,10,9,15,17,19,17,15,15,13,10,9,9,13,16,20])
z = numpy.array([0,0,0,340,350,10,45,90,90,90,45,22.5,0,270,292,22.5,45,45,0,0])
points = numpy.array([x,y]).T.reshape(-1,1,2)
segments = numpy.concatenate([points[:-1], points[1:]], axis=1)
matplotlib.pyplot.title("Vitesse du vent a Lery-Poses")
matplotlib.pyplot.xlabel('Temps')
matplotlib.pyplot.ylabel('Vitesse (km/h)')
matplotlib.pyplot.grid(True)
lc = matplotlib.collections.LineCollection(segments, cmap=matplotlib.pyplot.get_cmap('Spectral'),norm=matplotlib.pyplot.Normalize(0,360))
lc.set_array(z)
lc.set_linewidth(2)
matplotlib.pyplot.gca().add_collection(lc)
matplotlib.pyplot.xlim(0,20)
matplotlib.pyplot.ylim(0,25)
cbar = matplotlib.pyplot.gcf().colorbar(lc,ticks=[0,45,90,135,180,225,270,315,360])
cbar.ax.set_yticklabels(['N','NE','E','SE','S','SO','O','NO','N'])
cbar.set_label('Direction du vent (en degres)')
The current wind history graph shows the wind speed, with no information related to the wind direction.
Proposal is to combine wind speed & wind direction in a single plot, by using different colors, based on the wind direction.
See http://stackoverflow.com/questions/8945699/gnuplot-linecolor-variable-in-matplotlib/18516488#18516488 for a possible solution.
The text was updated successfully, but these errors were encountered: