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
_to_ordinalf is used by num2date to actually convert floating
point numbers to datetime objects. The main purpose of this conversion
is to prepare the datetimes from which tick labels are generated. Since
datetimes have microsecond resolution, but the input (float) does not
have microsecond precision for any modern date, a 10-microsecond
"snapping distance" around full seconds was used to obtain timestamps
suitable for tick labels with per-second and lower resolution.
However, when higher resolution is needed (which is now possible after
the introduction of Microsecond support in AutoDateLocator and
-Formatter in Matplotlib 2.0), unconditional full-second distance
snapping is not appropriate: It is unable to perform rounding to
milliseconds, and in addition may lead to multiple identical tick labels
at highest plotting time resolution.
The solution implemented here is to introduce a microsecond precision
parameter (`musec_prec`) to the appropriate functions and function
calls, and perform rounding to the nearest multiple of the given number
of microseconds. The default value of 20 offers the same effect as the
previous "snapping distance" around full seconds. In addition, it can
also be turned off (when set to 1) or be used to perform rounding to
full milliseconds.
0 commit comments