"""" EXAMPLES ======== :: $ python years_matplotlib.py EVOLUTIONS ========== """ import matplotlib.pyplot as plot import numpy as np import datetime fig = plot.figure() ax = fig.gca() # definition of axes ax.set_xlabel('Year') ax.set_ylabel('Nb of publications') # titre sur le graphique plot.title('nb of publications by year date : ') # dates=[] values=[] ax.set_ylim(min(values)-1, max(values)+1) ax.set_xlim(dates[0]-0.5, dates[-1]+0.5) plot.yticks(np.arange(min(values)-1,max(values)+1,1)) plot.bar(dates, values,width=0.5) # avoid overlap on labels fig.autofmt_xdate() # fig.savefig('/years.png') dates.append() values.append()