You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug : (minor) time axis labels show "%f" instead of microseconds for years up to 1900 #3179
When plotting with a timestamp-based axis with datetimes of years <= 1900, upon zooming into sub-second scales, the default axis label date formatter shows "%f" instead of microseconds.
This is since timetuple doesn't carry microsecond data. Minor in nature (was using a sentinel date of 1900 without realizing matplotlib would handle it specially) but I figured I would point it out.
changed the title [-]Bug : (minor) time.strftime doesn't carry microseconds[/-][+]Bug : (minor) time axis labels show "%f" instead of microseconds for years <= 1900[/+]on Jul 2, 2014
changed the title [-]Bug : (minor) time axis labels show "%f" instead of microseconds for years <= 1900[/-][+]Bug : (minor) time axis labels show "%f" instead of microseconds for years upto 1900[/+]on Jul 2, 2014
changed the title [-]Bug : (minor) time axis labels show "%f" instead of microseconds for years upto 1900[/-][+]Bug : (minor) time axis labels show "%f" instead of microseconds for years up to 1900[/+]on Jul 2, 2014
although someone should check that setting to this year in a datetime object will not somehow re-introduce the year before 1900 issue that dates.DateFormatter.stftime was trying to resolve. It seems the updated year value indeed is between 1973 and 2000. I'll submit a pull request in a bit.
Activity
[-]Bug : (minor) time.strftime doesn't carry microseconds[/-][+]Bug : (minor) time axis labels show "%f" instead of microseconds for years <= 1900[/+][-]Bug : (minor) time axis labels show "%f" instead of microseconds for years <= 1900[/-][+]Bug : (minor) time axis labels show "%f" instead of microseconds for years upto 1900[/+][-]Bug : (minor) time axis labels show "%f" instead of microseconds for years upto 1900[/-][+]Bug : (minor) time axis labels show "%f" instead of microseconds for years up to 1900[/+]pelson commentedon Jul 2, 2014
Good spot @azjps, and thanks for making it easy to reproduce. Are you interested in having a go at implementing a fix for this?
azjps commentedon Jul 2, 2014
Sure :) It seems to me that these three lines in
dates.DateFormatter.strftime:could be replaced by
although someone should check that setting to this year in a
datetimeobject will not somehow re-introduce the year before 1900 issue thatdates.DateFormatter.stftimewas trying to resolve. It seems the updated year value indeed is between 1973 and 2000. I'll submit a pull request in a bit.DateFormatter shows microseconds instead of %f for years <= 1900
DateFormatter shows microseconds instead of %f for years <= 1900
DateFormatter shows microseconds instead of %f for years <= 1900
DateFormatter shows microseconds instead of %f for years <= 1900
DateFormatter shows microseconds instead of %f for years <= 1900