HomeLanguagesMatplotlib.axis.Axis.get_minor_locator() function in Python

Matplotlib.axis.Axis.get_minor_locator() 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_minor_locator() Function

The Axis.get_minor_locator() function in axis module of matplotlib library is used to get the locator of the minor ticker.
 

Syntax: Axis.get_minor_locator(self)

Parameters: This method does not accepts any parameters.
 

Return value: This method returns the locator of the minor ticker. 

Below examples illustrate the matplotlib.axis.Axis.get_minor_locator() 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   
    
x = np.linspace(0, 10, 1000) 
y = np.sin(2 * x) 
    
fig = plt.figure() 
ax = fig.add_subplot(111) 
    
ax.plot(x, y)
ax.grid()
  
print(Axis.get_minor_locator(ax.yaxis))
  
plt.title("Matplotlib.axis.Axis.get_minor_locator()\n\
Function Example", fontsize = 12, fontweight ='bold') 
plt.show()


Output: 
 

 

<matplotlib.ticker.NullLocator object at 0x086D8C30>

Example 2:
 

Python3




# Implementation of matplotlib function 
import numpy as np
from matplotlib.axis import Axis  
import matplotlib.pyplot as plt   
    
np.random.seed(19680801)  
    
fig, ax = plt.subplots()  
      
x, y, s, c = np.random.rand(4, 100)  
s *= 100
      
ax.scatter(x, y, s, c)
ax.grid()  
  
print(Axis.get_minor_locator(ax.xaxis))
  
plt.title("Matplotlib.axis.Axis.get_minor_locator()\n\
Function Example", fontsize = 12, fontweight ='bold') 
plt.show()


Output: 
 

 

<matplotlib.ticker.NullLocator object at 0x08AE9830>

 

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

Most Popular

Dominic
32548 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6922 POSTS0 COMMENTS
Nicole Veronica
12037 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12143 POSTS0 COMMENTS
Shaida Kate Naidoo
7057 POSTS0 COMMENTS
Ted Musemwa
7296 POSTS0 COMMENTS
Thapelo Manthata
7015 POSTS0 COMMENTS
Umr Jansen
7001 POSTS0 COMMENTS