# matplotlib.pyplot.autoscale¶

matplotlib.pyplot.autoscale(enable=True, axis='both', tight=None)[source]

Autoscale the axis view to the data (toggle).

Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or axes.

Parameters: enablebool or None, optionalTrue (default) turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged. axis{'both', 'x', 'y'}, optionalWhich axis to operate on; default is 'both'. tightbool or None, optionalIf True, first set the margins to zero. Then, this argument is forwarded to autoscale_view (regardless of its value); see the description of its behavior there.