Hello, i am trying to plot information which will have on the x a timestamp imformation; even if i specify the formatter i want(see code below) , it seems to be ingnored in the labels, meaning, i don't see the time portion of it, just the date. The code is very simple since i am just testing; thanks for suggestions in what i am doing wrong, best regards
Margherita ---------------------------------------------------------- from pylab import * from pylab import figure, show, datestr2num, load from matplotlib.dates import DateFormatter import datetime id_list=[1,2,3,4,5,6] str_dates=['2006-07-29 11:01:01','2006-07-29 10:02:03','2006-07-31 00:00:00', '2006-08-01 10:11:12','2006-08-02 09:09:09','2006-08-03 08:08:08'] id_dates=datestr2num(str_dates) # It appears to ignore the formatting, it shows the month,day and year but not the time... formatter = DateFormatter('%m-%d-%y %H:%M:%S') ax = subplot(111) ax.plot_date(id_dates,id_list) ax.xaxis.set_major_formatter(dateFormatter) labels = ax.get_xticklabels() setp(labels, rotation=30, fontsize=8) ax.set_title(" test dates") show() ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users