IndexLocator

class IndexLocator(base=1, offset=0)[source]

Bases: Locator

Format numbers by assigning fixed strings to non-negative indices. The ticks are restricted to the extent of plotted content when content is present.

Methods Summary

__call__()

Return the locations of the ticks.

set_params([base, offset])

Do nothing, and raise a warning.

tick_values(vmin, vmax)

Return the values of the located ticks given vmin and vmax.

Methods Documentation

__call__()[source]

Return the locations of the ticks.

set_params(base=None, offset=None)[source]

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]