|
From: Skip M. <sk...@po...> - 2013-07-12 14:02:05
|
On Fri, Jul 12, 2013 at 8:47 AM, Skip Montanaro <sk...@po...> wrote:
> Is there some way to get the x axis to display
> fractions of a second? There is no strftime format character
> corresponding to that. (I proposed one on python-dev several years
> ago, but I don't think it was ever adopted.)
My memory failed me. I not only proposed, but submitted the necessary
patches which were accepted. However, this only works for datetime
objects:
>>> import datetime
>>> datetime.datetime.now().strftime("%H:%M:%S.%f")
'08:58:57.854562'
It's not supported by time.strftime:
>>> import time
>>> time.time()
1373637581.478104
>>> time.strftime("%H:%M:%S.%f", time.localtime())
'09:00:10.%f'
which I suspect is what matplotlib uses if it converts datetime
objects to floats internally.
Skip
|