You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Applications are open for the 2018 John Hunter Matplotlib Summer Fellowship. Apply now!
Version 2.2.2.post1744+g9382a0569
Fork me on GitHub


Axes.axis(*v, **kwargs)

Convenience method to get or set some axis properties.

Call 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)
v : List[float] or one of the strings listed below.

Optional positional-only argument

If a list, set the axis data limits. If a string:

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

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.

xmin, xmax, ymin, ymax : float

The axis limits.