Locator
- Locator(locator, *args, discrete=False, **kwargs)[source]
Return a
Locatorinstance.- Parameters:
locator (
Locator,str,bool,float, or sequence) – The locator specification, interpreted as follows:If a
Locatorinstance already, acopy.copyof the instance is returned.If
False, aNullLocatoris used, and ifTrue, the defaultAutoLocatoris used.If a number, this specifies the step size between tick locations. Returns a
MultipleLocator.If a sequence of numbers, these points are ticked. Returns a
FixedLocatorby default or aDiscreteLocatorifdiscreteisTrue.
Otherwise,
locatorshould be a string corresponding to one of the “registered” locators (see below table). Iflocatoris 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,uplt.Locator(('multiple', 5))is equivalent touplt.Locator('multiple', 5).Key
Class
Description
'null','none'No ticks
'auto'Major ticks at sensible locations
'minor'Minor ticks at sensible locations
'date'Default tick locations for datetime axes
'fixed'Ticks at these exact locations
'discrete'Major ticks restricted to these locations but subsampled depending on the axis length
'discreteminor'Minor ticks restricted to these locations but subsampled depending on the axis length
'index'Ticks on the non-negative integers
'linear'Exactly
Nticks encompassing axis limits, spaced asnumpy.linspace(lo, hi, N)'log'For log-scale axes
'logminor'For log-scale axes on the 1st through 9th multiples of each power of the base
'logit'For logit-scale axes
'logitminor'For logit-scale axes with
minor=Truepassed toLogitLocator'maxn'No more than
Nticks at sensible locations'multiple'Ticks every
Nstep away from zero'symlog'For symlog-scale axes
'symlogminor'For symlog-scale axes on the 1st through 9th multiples of each power of the base
'theta'Like the base locator but default locations are every
numpy.pi/ 8 radians'year'Ticks every
Nyears'month'Ticks every
Nmonths'weekday'Ticks every
Nweekdays'day'Ticks every
Ndays'hour'Ticks every
Nhours'minute'Ticks every
Nminutes'second'Ticks every
Nseconds'microsecond'Ticks every
Nmicroseconds'lon','deglon'Longitude gridlines at sensible decimal locations
'lat','deglat'Latitude gridlines at sensible decimal locations
'dms'Gridlines on nice minute and second intervals
'dmslon'Longitude gridlines on nice minute and second intervals
'dmslat'Latitude gridlines on nice minute and second intervals
- Other Parameters:
*args, **kwargs – Passed to the
Locatorclass.- Returns:
matplotlib.ticker.Locator– ALocatorinstance.