You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.0.0b1.post7580.dev0+ge487118
matplotlib
Fork me on GitHub

This Page

matplotlib.axes.Axes.axis

Axes.axis(*v, **kwargs)

Set axis properties.

Valid signatures:

xmin, xmax, ymin, ymax = axis()
xmin, xmax, ymin, ymax = axis(list_arg)
xmin, xmax, ymin, ymax = axis(string_arg)
xmin, xmax, ymin, ymax = axis(**kwargs)
Parameters:

v : list of float or {‘on’, ‘off’, ‘equal’, ‘tight’, ‘scaled’, ‘normal’, ‘auto’, ‘image’, ‘square’}

Optional positional argument

Axis data limits set from a list; or a command relating to axes:

Value Description
‘on’ Toggle axis lines and labels on
‘off’ Toggle axis lines and labels off
‘equal’ Equal scaling by changing limits
‘scaled’ Equal scaling by changing box dimensions
‘tight’ Limits set such that all data is shown
‘auto’ Automatic scaling, fill rectangle 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

Passed to set_{x,y}lim functions, if observers are notified of axis limit change

xmin, ymin, xmax, ymax : float, optional

The axis limits to be set

Returns:

xmin, xmax, ymin, ymax : float

The axis limits