Saturday, April 4, 2026
HomeLanguagesMatplotlib.axis.Axis.get_minorticklabels() function in Python

Matplotlib.axis.Axis.get_minorticklabels() function in Python

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.Axis.get_minorticklabels() Function

The Axis.get_minorticklabels() function in axis module of matplotlib library is used to get the list of Text instances for the minor ticklabels.
 

Syntax: Axis.get_minorticklabels(self) 

Parameters: This method does not accepts any parameter. 
 

Return value: This method returns the list of Text instances for the minor ticklabels. 

Below examples illustrate the matplotlib.axis.Axis.get_minorticklabels() function in matplotlib.axis:
 

Example 1:

Python3




# Implementation of matplotlib function 
import numpy as np
from matplotlib.axis import Axis  
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
      
np.random.seed(19680801)
   
fig, ax = plt.subplots()
ax.plot(100*np.random.rand(20))
   
Axis.set_minor_locator(ax.xaxis, ticker.MultipleLocator(1)) 
   
print("Value of get_minorticklabels() :")
for i in ax.xaxis.get_minorticklabels():
    print(i)
       
plt.title("Matplotlib.axis.Axis.get_minorticklabels()\n\
Function Example", fontsize = 12, fontweight ='bold'
  
plt.show()


Output: 
 

 

Value of get_minorticklabels() :
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')
Text(0, 0, '')

Example 2:

Python3




# Implementation of matplotlib function 
import numpy as np
from matplotlib.axis import Axis  
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
   
fig, ax = plt.subplots()
ax.plot(np.random.rand(1000),'go')
   
Axis.set_minor_locator(ax.yaxis, ticker.MultipleLocator(1))
  
print("Value of get_minorticklabels() :")
for i in ax.yaxis.get_minorticklabels():
    print(i)
       
plt.title("Matplotlib.axis.Axis.get_minorticklabels()\n\
Function Example", fontsize = 12, fontweight ='bold'
  
plt.show()


Output: 
 

 

Value of get_minorticklabels() :
Text(0, 0, '')
Text(0, 0, '')
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32512 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6886 POSTS0 COMMENTS
Nicole Veronica
12007 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12100 POSTS0 COMMENTS
Shaida Kate Naidoo
7015 POSTS0 COMMENTS
Ted Musemwa
7259 POSTS0 COMMENTS
Thapelo Manthata
6972 POSTS0 COMMENTS
Umr Jansen
6960 POSTS0 COMMENTS