spacepy_logo

Previous topic

spacepy.plot.utils.annotate_xaxis

Next topic

spacepy.plot.utils.collapse_vertical

This Page

spacepy.plot.utils.applySmartTimeTicks

spacepy.plot.utils.applySmartTimeTicks(ax, time, dolimit=True)[source]

Given an axis ‘ax’ and a list/array of datetime objects, ‘time’, use the smartTimeTicks function to build smart time ticks and then immediately apply them to the given axis. The first and last elements of the time list will be used as bounds for the x-axis range.

The range of the ‘time’ input value will be used to set the limits of the x-axis as well. Set kwarg ‘dolimit’ to False to override this behavior.

Parameters:

ax : matplotlib.pyplot.Axes

A matplotlib Axis object.

time : list

list of datetime objects

dolimit : boolean (optional)

The range of the ‘time’ input value will be used to set the limits of the x-axis as well. Setting this overrides this behavior.

See also

smartTimeTicks