|
From: Benjamin R. <ben...@ou...> - 2012-10-10 13:29:58
|
On Mon, Oct 8, 2012 at 12:06 PM, Jianbao Tao <jia...@gm...> wrote: > Thanks, Ben. > > Your fix works when the view interval is greater than 1 minute, but not so > much when the view interval is less than one minute. > > BTW, what I am trying to accomplish is to use matplotlib to plot > time-series data that can be as long as several days and as short as a few > milliseconds. So, do you think I am better off to handle the format > manually by myself instead of deriving the format from auto locator? I am > skeptical about the auto locator now because it doesn't seem to be designed > for intervals less than 1 second. > > Cheers, > Jianbao > > Jianbao, your smallest scale in your AutoDateFormatter dictionary is 1 second. The formatter is designed to find the smallest key that is still greater than or equal to the scale of your axis. So, if your scale is less than 1 second, then you will notice formatting issues. I would try adding a few more entries to see if that would help. I know of a few people who have difficulties with matplotlib's datetime handling, but they are usually operating on the scale of milliseconds or less (lightning data), in which case, one is already at the edge of the resolution handled by python's datetime objects. However, we would certainly welcome any sort of examples of how matplotlib fails in handling seconds scale and lower plots. Cheers! Ben Root |