Matplotlib.pyplot.autoscale() in Python
Matplotlib is a widely used library in Python for plotting various graphs, as it provides very efficient ways and easy to understand methods for complex plots also. matplotlib.pyplot is a plotting library used for 2D graphics in Python programming language. Pyplot is a collection of command style functions that make matplotlib work like MATLAB.
matplotlib.pyplot.autoscale() is a 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.
Syntax: matplotlib.pyplot.autoscale(enable=True, axis=’both’, tight=None)
enable is a Boolean valued parameter, if it is set to True the autoscaling is on else auto-scaling is off. It is an optional parameter. When not specified, it takes the default value as ‘true’.
axis is another optional parameter which states that axis to operate on. Usually it can be ‘both’, ‘x’, or ‘y’. When not specified, it takes default value as ‘both’.
tight takes the boolean argument, If True, first set the margins to zero. Then, this argument is forwarded to autoscale_view (regardless of its value). This is also an optional parameter of the autoscale method.