Thursday, November 20, 2025
HomeLanguagesMatplotlib.axes.Axes.get_autoscaley_on() in Python

Matplotlib.axes.Axes.get_autoscaley_on() in Python

Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.

matplotlib.axes.Axes.get_autoscaley_on() Function

The Axes.get_autoscaley_on() function in axes module of matplotlib library is used to get whether autoscaling for the y-axis is applied on plot commands.

Syntax: Axes.get_autoscaley_on(self)

Parameters: This method does not accepts any parameters.

Return value: This method returns the boolean value.

Below examples illustrate the matplotlib.axes.Axes.get_autoscaley_on() function in matplotlib.axes:

Example 1:




# ImpleIn Reviewtation of matplotlib function  
import numpy as np
import matplotlib.pyplot as plt
    
t = np.linspace(0, 20, 300)
xdata = np.sin(np.pi * t / 12)
ydata = np.cos(4 * np.pi * t / 21)
    
fig, ax = plt.subplots()
    
ax.plot(xdata, ydata, 'g-')
w = ax.get_autoscaley_on()
ax.text(-0.5, -0.75, "Value return by get_autoscaley_on : "
        + str(w),
        fontweight ="bold")
fig.suptitle('matplotlib.axes.Axes.get_autoscaley_on() function \
Example\n', fontweight ="bold")
fig.canvas.draw()
plt.show()


Output:

Example 2:




# ImpleIn Reviewtation of matplotlib function  
import numpy as np
import matplotlib.pyplot as plt
    
t = np.linspace(16, 365, (365-16)*4)
xdata = np.sin(2 * np.pi * t / 15)
ydata = np.cos(2 * np.pi * t / 12)
    
fig, (ax, ax1) = plt.subplots(1, 2)
    
ax.plot(xdata, ydata, 'g-', alpha = 0.6)
ax.set_title("Axes 1")
ax1.plot(xdata, ydata, 'g-', alpha = 0.6)
ax1.set_autoscaley_on(False)
ax1.set_title("Axes 2")
  
w = ax.get_autoscaley_on()
w1 = ax1.get_autoscaley_on()
ax.text(-0.5, 0, "Value return : " + str(w),
        fontweight ="bold")
ax1.text(-0.5, 0.5, "Value return : " + str(w1),
         fontweight ="bold")
  
fig.suptitle('matplotlib.axes.Axes.get_autoscaley_on() \
function Example\n', fontweight ="bold")
fig.canvas.draw()
plt.show()


Output:

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32404 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6776 POSTS0 COMMENTS
Nicole Veronica
11924 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11994 POSTS0 COMMENTS
Shaida Kate Naidoo
6904 POSTS0 COMMENTS
Ted Musemwa
7160 POSTS0 COMMENTS
Thapelo Manthata
6860 POSTS0 COMMENTS
Umr Jansen
6846 POSTS0 COMMENTS