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)
The axis limits to be set. This can also be achieved using
ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax))
If a bool, turns axis lines and labels on or off. If a string, possible values are:
Value | Description |
|---|---|
'off' or | Hide all axis decorations, i.e. axis labels, spines, tick marks, tick labels, and grid lines. This is the same as |
'on' or | Do not hide all axis decorations, i.e. axis labels, spines, tick marks, tick labels, and grid lines. This is the same as |
'equal' | Set equal scaling (i.e., make circles circular) by changing the axis limits. This is the same as |
'scaled' | Set equal scaling (i.e., make circles circular) by changing dimensions of the plot box. This is the same as |
'tight' | Set limits just large enough to show all data, then disable further autoscaling. |
'auto' | Automatic scaling (fill plot box with data). |
'image' | 'scaled' with axis limits equal to data limits. |
'square' | Square plot; similar to 'scaled', but initially forcing |
Whether observers are notified of the axis limit change. This option is passed on to set_xlim and set_ylim.
The axis limits.
Note
This is the pyplot wrapper for axes.Axes.axis.
For 3D Axes, this method additionally takes zmin, zmax as parameters and likewise returns them.
matplotlib.pyplot.axis
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.axis.html