matplotlib 3.5.1

NotesParametersBackRef

It may be instantiated directly, or subclassed.

Notes

The :None:None:`set_locs` method must be called to enable the subsetting logic controlled by the minor_thresholds parameter.

In some cases such as the colorbar, there is no distinction between major and minor ticks; the tick locations might be set manually, or by a locator that puts ticks at integer powers of base and at intermediate locations. For this situation, disable the minor_thresholds logic by using minor_thresholds=(np.inf, np.inf) , so that all ticks will be labeled.

To disable labeling of minor ticks when 'labelOnlyBase' is False, use minor_thresholds=(0, 0) . This is the default for the "classic" style.

Parameters

base : float, default: 10.

Base of the logarithm used in all calculations.

labelOnlyBase : bool, default: False

If True, label ticks only at integer powers of base. This is normally True for major ticks and False for minor ticks.

minor_thresholds : (subset, all), default: (1, 0.4)

If labelOnlyBase is False, these two numbers control the labeling of ticks that are not at integer powers of base; normally these are the minor ticks. The controlling parameter is the log of the axis data range. In the typical case where base is 10 it is the number of decades spanned by the axis, so we can call it 'numdec'. If numdec <= all , all minor ticks will be labeled. If all < numdec <= subset , then only a subset of minor ticks will be labeled, so as to avoid crowding. If numdec > subset then no minor ticks will be labeled.

linthresh : None or float, default: None

If a symmetric log scale is in use, its linthresh parameter must be supplied here.

Base class for formatting ticks on a log or symlog scale.

Examples

To label a subset of minor ticks when the view limits span up to 2 decades, and all of the ticks when zoomed in to 0.5 decades or less, use minor_thresholds=(2, 0.5) .

To label all minor ticks when the view limits span up to 1.5 decades, use minor_thresholds=(1.5, 1.5) .

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.ticker

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/ticker.py#821
type: <class 'type'>
Commit: