egttools.plotting.indicators.AutoMinorLocator¶
- class AutoMinorLocator(n=None)[source]¶
Bases:
Locator
Place evenly spaced minor ticks, with the step size and maximum number of ticks chosen automatically.
The Axis must use a linear scale and have evenly spaced major ticks.
- Parameters:
n (int or ‘auto’, default: :rc:`xtick.minor.ndivs` or :rc:`ytick.minor.ndivs`) –
The number of subdivisions of the interval between major ticks; e.g., n=2 will place a single minor tick midway between major ticks.
If n is ‘auto’, it will be set to 4 or 5: if the distance between the major ticks equals 1, 2.5, 5 or 10 it can be perfectly divided in 5 equidistant sub-intervals with a length multiple of 0.05; otherwise, it is divided in 4 sub-intervals.
Methods
Adjust a range as needed to avoid singularities.
Log at WARNING level if locs is longer than Locator.MAXTICKS.
Do nothing, and raise a warning.
Return the values of the located ticks given vmin and vmax.
Select a scale for the range from vmin to vmax.
Attributes
- __init__(n=None)[source]¶
- Parameters:
n (int or ‘auto’, default: :rc:`xtick.minor.ndivs` or :rc:`ytick.minor.ndivs`) –
The number of subdivisions of the interval between major ticks; e.g., n=2 will place a single minor tick midway between major ticks.
If n is ‘auto’, it will be set to 4 or 5: if the distance between the major ticks equals 1, 2.5, 5 or 10 it can be perfectly divided in 5 equidistant sub-intervals with a length multiple of 0.05; otherwise, it is divided in 4 sub-intervals.
- create_dummy_axis(**kwargs)¶
- nonsingular(v0, v1)¶
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with
(v0, v1)
set to the data limits on the Axes if the Axes contains any data, or(-inf, +inf)
if not.If
v0 == v1
(possibly up to some floating point slop), this method returns an expanded interval around this value.If
(v0, v1) == (-inf, +inf)
, this method returns appropriate default view limits.Otherwise,
(v0, v1)
is returned without modification.
- raise_if_exceeds(locs)¶
Log at WARNING level if locs is longer than Locator.MAXTICKS.
This is intended to be called immediately before returning locs from
__call__
to inform users in case their Locator returns a huge number of ticks, causing Matplotlib to run out of memory.The “strange” name of this method dates back to when it would raise an exception instead of emitting a log.
- set_axis(axis)¶
- set_params(**kwargs)¶
Do nothing, and raise a warning. Any locator class not supporting the set_params() function will call this.
- tick_values(vmin, vmax)[source]¶
Return the values of the located ticks given vmin and vmax.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated
axis
simply call the Locator instance:>>> print(type(loc)) <type 'Locator'> >>> print(loc()) [1, 2, 3, 4]
- view_limits(vmin, vmax)¶
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
- MAXTICKS = 1000¶
- __annotations__ = {}¶
- axis = None¶