I thought I'd explain it myself, but since ʻaxis` is too convenient to say, I'll post a Japanese translation of the manual. Please see nbviewer for a display example.
matplotlib.pyplot.axis(*v, **kwargs)
Convenience method to get or set axis properties. This is a convenient way to set and get the axes.
Calling with no arguments: When called with no arguments:
axis()
returns the current axes limits [xmin, xmax, ymin, ymax].: Returns the maximum / minimum of the currently displayed coordinates in the format [xmin, xmax, ymin, ymax].
axis(v)
sets the min and max of the x and y axes, with v = [xmin, xmax, ymin, ymax].: Calling with v = [xmin, xmax, ymin, ymax] as an argument sets the maximum and minimum of x and y, respectively.
axis('off')
turns off the axis lines and labels.: Hide the axes.
axis('equal')
changes limits of x or y axis so that equal increments of x and y have the same length; a circle is circular.: Adjust the upper and lower limits of x or y so that the increments of the same coordinate value have the same length. The circle is displayed properly in a circle.
axis('scaled')
achieves the same result by changing the dimensions of the plot box instead of the axis data limits.: You can get the same effect (as in the case of'equal') by adjusting the displayed area (with the upper and lower limits unchanged).
axis('tight')
changes x and y axis limits such that all data is shown. If all data is already shown, it will move it to the center of the figure without modifying (xmax - xmin) or (ymax - ymin). Note this is slightly different than in MATLAB.: Change the maximum / minimum so that all data can be seen. If you can already see it, move the display area to the center without changing (xmax --xmin) or (ymax --ymin). Please note that it is slightly different from the case of MATLAB.
axis('image')
is ‘scaled’ with the axis limits equal to the data limits.: After using the maximum and minimum of the data, the effect of'scaled'is further obtained.
axis('auto')
and: When
axis('normal')
are deprecated. They restore default behavior; axis limits are automatically scaled to make the data fit comfortably within the plot box. Will be abolished. These restore the default settings. Make sure the data fits nicely into the plot area.
if len(*v)==0
, you can pass in xmin, xmax, ymin, ymax as kwargs selectively to alter just those limits without changing the others.
When len (* v) == 0
, xmin, xmax, ymin, ymax can be selectively given as keyword arguments. The settings that were not given at this time will be reflected as they are.
The xmin, xmax, ymin, ymax tuple is returned
See also
xlim(),ylim() For setting the x- and y-limits individually.
Recommended Posts