Last Updated : 12 Jul, 2025
Matplotlibis a library in Python and it is numerical – mathematical extension for NumPy library. The
Axes Classcontains 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.set_visible() FunctionThe
Axes.set_visible() functionin axes module of matplotlib library is used to set the artist's visibility.
Syntax: Axes.set_visible(self, b) Parameters: This method accepts only one parameters.Returns: This method does not return any value.
- b: This parameter is the boolean value.
Below examples illustrate the matplotlib.axes.Axes.set_visible() function in matplotlib.axes:
Example 1: Python3
# Implementation of matplotlib function
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import Subplot
fig = plt.figure()
ax = Subplot(fig, 111)
fig.add_subplot(ax)
ax.axis["left"].set_visible(False)
ax.axis["top"].set_visible(False)
fig.suptitle('matplotlib.axes.Axes.set_visible()\
function Example\n', fontweight ="bold")
plt.show()
Output: Example-2: Python3
# Implementation of matplotlib function
import matplotlib.pyplot as plt
import numpy as np
X = np.arange(-20, 20, 0.5)
Y = np.arange(-20, 20, 0.5)
U, V = np.meshgrid(X, Y)
fig, ax = plt.subplots()
ax.quiver(X, Y, U, V)
w = ax.get_xaxis()
w.set_visible(False)
fig.suptitle('matplotlib.axes.Axes.set_visible() \
function Example\n', fontweight ="bold")
plt.show()
Output:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4