MinorSymLogLocator

class MinorSymLogLocator(linthresh: float, nints: int = 10)[source]

Dynamically find minor tick positions based on major ticks for a symlog scaling.

Ref.: https://stackoverflow.com/a/45696768

Ticks will be placed between the major ticks.

The placement is linear for x between -linthresh and linthresh, otherwise its logarithmically. nints gives the number of intervals that will be bounded by the minor ticks.

Parameters:
  • linthresh (float) – A single float which defines the range (-x, x), within which the plot is linear.

  • nints (int) – Number of minor tick between major ticks. Defaults to 10

Attributes Summary

MAXTICKS

axis

Methods Summary

create_dummy_axis

nonsingular

Adjust a range as needed to avoid singularities.

raise_if_exceeds

Log at WARNING level if locs is longer than Locator.MAXTICKS.

set_axis

set_params

Do nothing, and raise a warning.

tick_values

Return the values of the located ticks given _vmin and _vmax (not implemented).

view_limits

Select a scale for the range from vmin to vmax.

Methods Documentation

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: float, _vmax: float) None[source]

Return the values of the located ticks given _vmin and _vmax (not implemented).

Parameters:
  • _vmin (float) – Minimum value.

  • _vmax (float) – Maximum value.

Raises:

NotImplementedError – Not used

view_limits(vmin, vmax)

Select a scale for the range from vmin to vmax.

Subclasses should override this method to change locator behaviour.