Thursday, January 22, 2026
HomeLanguagesMatplotlib.axes.Axes.get_visible() in Python

Matplotlib.axes.Axes.get_visible() 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_visible() Function

The Axes.get_visible() function in axes module of matplotlib library is used to get the visibility.

Syntax: Axes.get_visible(self)

Parameters: This method does not accepts any parameter.

Returns: This method return the visibility.

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

Example 1:




# Implementation of matplotlib function
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import Subplot
    
  
fig, ax = plt.subplots()
  
ax.plot([1, 2, 34, 67, 43, 5, 8])
  
ax.set_title("Visibility : " +str(ax.get_visible()))
         
fig.suptitle('matplotlib.axes.Axes.get_visible()\
 function Example\n', fontweight ="bold")
  
plt.show()


Output:

Example 2:




# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import Subplot
    
fig = plt.figure()
    
ax = Subplot(fig, 111)
fig.add_subplot(ax)
         
X = np.arange(-20, 20, 0.5)
Y = np.arange(-20, 20, 0.5)
U, V = np.meshgrid(X, Y)
     
ax.quiver(X, Y, U, V)
  
ax.axis["bottom"].set_visible(False)
ax.axis["top"].set_visible(False)
    
print("Visibilities of Axis")
print("Bottom :", ax.axis["bottom"].get_visible(),
      "\nTop :", ax.axis["top"].get_visible(),
      "\nLeft :", ax.axis["left"].get_visible(),
      "\nRight :", ax.axis["right"].get_visible())
         
fig.suptitle('matplotlib.axes.Axes.get_visible() \
function Example\n', fontweight ="bold")
  
plt.show()


Output:

Visibilities of Axis
Bottom : False 
Top : False 
Left : True 
Right : True
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12064 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7220 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS