nc_time_axis.NetCDFTimeDateLocator
- class nc_time_axis.NetCDFTimeDateLocator(max_n_ticks, calendar, date_unit=None, min_n_ticks=3)
Determines tick locations when plotting
cftime.datetimedata.- Parameters
- max_n_ticksint
The maximum number of ticks along the axis. This is passed internally to a
matplotlib.ticker.MaxNLocatorclass.- calendarstr
The calendar type of the axis, e.g.
"noleap". See thecftime.datetimedocumentation for a full list of valid calendar strings.- date_unitstr
The time units the numeric tick values represent. Note this will be deprecated in nc-time-axis version 1.5.
- min_n_ticksint, default 3
The minimum number of ticks along the axis. Note this is currently not used.
- Attributes
- axis
Methods
__call__()Return the locations of the ticks.
compute_resolution(num1, num2, date1, date2)Returns the resolution of the dates (hourly, minutely, yearly), and an approximate number of those units.
nonsingular(v0, v1)Adjust a range as needed to avoid singularities.
raise_if_exceeds(locs)Log at WARNING level if locs is longer than Locator.MAXTICKS.
set_bounds(vmin, vmax)[Deprecated]
set_data_interval(vmin, vmax)[Deprecated]
set_params(**kwargs)Do nothing, and raise a warning.
set_view_interval(vmin, vmax)[Deprecated]
tick_values(vmin, vmax)Return the values of the located ticks given vmin and vmax.
view_limits(vmin, vmax)Select a scale for the range from vmin to vmax.
create_dummy_axis
set_axis
- __init__(max_n_ticks, calendar, date_unit=None, min_n_ticks=3)
Methods
__init__(max_n_ticks, calendar[, date_unit, ...])compute_resolution(num1, num2, date1, date2)Returns the resolution of the dates (hourly, minutely, yearly), and an approximate number of those units.
create_dummy_axis(**kwargs)nonsingular(v0, v1)Adjust a range as needed to avoid singularities.
raise_if_exceeds(locs)Log at WARNING level if locs is longer than Locator.MAXTICKS.
set_axis(axis)set_bounds(vmin, vmax)[Deprecated]
set_data_interval(vmin, vmax)[Deprecated]
set_params(**kwargs)Do nothing, and raise a warning.
set_view_interval(vmin, vmax)[Deprecated]
tick_values(vmin, vmax)Return the values of the located ticks given vmin and vmax.
view_limits(vmin, vmax)Select a scale for the range from vmin to vmax.
Attributes
MAXTICKSaxisreal_world_calendars