Locator

Locator(locator, *args, discrete=False, **kwargs)[source]

Return a Locator instance.

Parameters

locator (Locator, str, bool, float, or sequence) – The locator specification, interpreted as follows:

Otherwise, locator should be a string corresponding to one of the “registered” locators (see below table). If locator is a list or tuple and the first element is a “registered” locator name, subsequent elements are passed to the locator class as positional arguments. For example, pplt.Locator(('multiple', 5)) is equivalent to pplt.Locator('multiple', 5).

Key

Class

Description

'null', 'none'

NullLocator

No ticks

'auto'

AutoLocator

Major ticks at sensible locations

'minor'

AutoMinorLocator

Minor ticks at sensible locations

'date'

AutoDateLocator

Default tick locations for datetime axes

'fixed'

FixedLocator

Ticks at these exact locations

'discrete'

DiscreteLocator

Major ticks restricted to these locations but subsampled depending on the axis length

'discreteminor'

DiscreteLocator

Minor ticks restricted to these locations but subsampled depending on the axis length

'index'

IndexLocator

Ticks on the non-negative integers

'linear'

LinearLocator

Exactly N ticks encompassing axis limits, spaced as numpy.linspace(lo, hi, N)

'log'

LogLocator

For log-scale axes

'logminor'

LogLocator

For log-scale axes on the 1st through 9th multiples of each power of the base

'logit'

LogitLocator

For logit-scale axes

'logitminor'

LogitLocator

For logit-scale axes with minor=True passed to LogitLocator

'maxn'

MaxNLocator

No more than N ticks at sensible locations

'multiple'

MultipleLocator

Ticks every N step away from zero

'symlog'

SymmetricalLogLocator

For symlog-scale axes

'symlogminor'

SymmetricalLogLocator

For symlog-scale axes on the 1st through 9th multiples of each power of the base

'theta'

ThetaLocator

Like the base locator but default locations are every numpy.pi / 8 radians

'year'

YearLocator

Ticks every N years

'month'

MonthLocator

Ticks every N months

'weekday'

WeekdayLocator

Ticks every N weekdays

'day'

DayLocator

Ticks every N days

'hour'

HourLocator

Ticks every N hours

'minute'

MinuteLocator

Ticks every N minutes

'second'

SecondLocator

Ticks every N seconds

'microsecond'

MicrosecondLocator

Ticks every N microseconds

'lon', 'deglon'

LongitudeLocator

Longitude gridlines at sensible decimal locations

'lat', 'deglat'

LatitudeLocator

Latitude gridlines at sensible decimal locations

'dms'

DegreeLocator

Gridlines on nice minute and second intervals

'dmslon'

LongitudeLocator

Longitude gridlines on nice minute and second intervals

'dmslat'

LatitudeLocator

Latitude gridlines on nice minute and second intervals

Other Parameters

*args, **kwargs – Passed to the Locator class.

Returns

matplotlib.ticker.Locator – A Locator instance.