Version 3.0.2
matplotlib
Fork me on GitHub

Table of Contents

matplotlib.pyplot.axis

matplotlib.pyplot.axis(*v, **kwargs)[source]

Convenience method to get or set some axis properties.

Call signatures:

xmin, xmax, ymin, ymax = axis()
xmin, xmax, ymin, ymax = axis(xmin, xmax, ymin, ymax)
xmin, xmax, ymin, ymax = axis(option)
xmin, xmax, ymin, ymax = axis(**kwargs)
Parameters:
xmin, ymin, xmax, ymax : float, optional

The axis limits to be set. Either none or all of the limits must be given.

option : str

Possible values:

Value Description
'on' Turn on axis lines and labels.
'off' Turn off axis lines and labels.
'equal' Set equal scaling (i.e., make circles circular) by changing axis limits.
'scaled' Set equal scaling (i.e., make circles circular) by changing dimensions of the plot box.
'tight' Set limits just large enough to show all data.
'auto' Automatic scaling (fill plot box with data).
'normal' Same as 'auto'; deprecated.
'image' 'scaled' with axis limits equal to data limits.
'square' Square plot; similar to 'scaled', but initially forcing xmax-xmin = ymax-ymin.
emit : bool, optional, default True

Whether observers are notified of the axis limit change. This option is passed on to set_xlim and set_ylim.

Returns:
xmin, xmax, ymin, ymax : float

The axis limits.