Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack.
Matplotlib.axis.Tick.set_visible() Function
The Tick.set_visible() function in axis module of matplotlib library is used to Copy properties from other to self.
Syntax: Tick.set_visible(self, b)
Parameters: This method accepts the following parameters.
- b: This parameter is the boolean value.
Return value: This method does not return any value.
Below examples illustrate the matplotlib.axis.Tick.set_visible() function in matplotlib.axis:
Example 1:
Python3
from matplotlib.axis import Tick
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import Subplot
fig = plt.figure()
ax = Subplot(fig, 111 )
fig.add_subplot(ax)
Tick.set_visible(ax.axis[ "right" ], False )
Tick.set_visible(ax.axis[ "top" ], False )
fig.suptitle('matplotlib.axis.Tick.set_visible() \
function Example', fontweight = "bold" )
plt.show()
|
Output:

Example 2:
Python3
from matplotlib.axis import Tick
import matplotlib.pyplot as plt
import numpy as np
X = np.arange( - 4 , 4 , 0.5 )
Y = np.arange( - 4 , 4 , 0.5 )
U, V = np.meshgrid(X * * 2 , Y * * 2 )
fig, ax = plt.subplots()
ax.quiver(X, Y, U, V)
w = ax.get_xaxis()
Tick.set_visible(w, False )
fig.suptitle('matplotlib.axis.Tick.set_visible() \
function Example', fontweight = "bold" )
plt.show()
|
Output:
