automatic date formatting of axes

I wrote this little snippet to automatically format the X axis of a line
plot I created with a dynamic range. It's not completely 100% perfect, but I
thought Id just post this here is anyone wants to use it, or maybe even
knows of another method to create the same effect more easily.

here are some examples:


View this message in context:
Sent from the matplotlib - users mailing list archive at