spacepy.plot.utils.smartTimeTicks¶
- spacepy.plot.utils.smartTimeTicks(time)[source]¶
Returns major ticks, minor ticks and format for time-based plots
smartTimeTicks takes a list of datetime objects and uses the range to calculate the best tick spacing and format. Returned to the user is a tuple containing the major tick locator, minor tick locator, and a format string – all necessary to apply the ticks to an axis.
It is suggested that, unless the user explicitly needs this info, to use the convenience function applySmartTimeTicks to place the ticks directly on a given axis.
- Parameters:
- timelist
list of datetime objects
- Returns:
- outtuple
tuple of Mtick - major ticks, mtick - minor ticks, fmt - format
See also