Iv got an error , when all the value in the list is the same, " b=points[a+1]-points[a]"=0 then "list_progre"=[0,0,0,0,0,0,0] and then : "progres=plot(dt_date, list_progre, '')" made me an error : "var = dv/max(abs(vmin), abs(vmax)) ZeroDivisionError: float division"
what can i do to stop this error thx The program test: from pylab import * list_progre=[] dt_date=[12,13,14,15,16,17,18,19] points=[25,25,25,25,25,25,25,25] num_fig=1 nom='test' chemin_fichier='C:\Python24\uni_33\\' long_list=len(points)-1 a=0 while a<long_list : b=points[a+1]-points[a] list_progre.append(b) a=a+1 f=figure(num_fig,figsize=(8,6), dpi=72) subplot(211) classt=plot(dt_date, points, '') setp(classt, color='r', linewidth=2.0) title('Nombre de point au classement general') xlabel('time') ylabel('points') del(dt_date[0]) subplot(212) progres=plot(dt_date, list_progre, '') setp(progres, color='g', linewidth=1.0) title('Progression') nom_fichier=string.replace(nom,' ','_') rep_fichier=chemin_fichier+'stat_img\\' savefig(rep_fichier+nom_fichier, dpi=50) show() #f.clf() _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users