matplotlib.axis.Axis.get_tick_params#

Axis.get_tick_params(which='major')[source]#

Get appearance parameters for ticks, ticklabels, and gridlines.

Added in version 3.7.

Parameters:
which{'major', 'minor'}, default: 'major'

The group of ticks for which the parameters are retrieved.

Returns:
dict

Properties for styling tick elements added to the axis.

Notes

This method returns the appearance parameters for stylingnewelements added to this axis and may be different from the valueson current elements if they were modified directly by the user(e.g., viaset_* methods on individual tick objects).

Examples

>>>ax.yaxis.set_tick_params(labelsize=30,labelcolor='red',...direction='out',which='major')>>>ax.yaxis.get_tick_params(which='major'){'direction': 'out','left': True,'right': False,'labelleft': True,'labelright': False,'gridOn': False,'labelsize': 30,'labelcolor': 'red'}>>>ax.yaxis.get_tick_params(which='minor'){'left': True,'right': False,'labelleft': True,'labelright': False,'gridOn': False}