Thursday, September 4, 2025
HomeLanguagesMatplotlib.axes.Axes.get_navigate_mode() in Python

Matplotlib.axes.Axes.get_navigate_mode() 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_navigate_mode() Function

The Axes.get_navigate_mode() Function in axes module of matplotlib library is used to get the navigation toolbar button status: ‘PAN’, ‘ZOOM’, or None.

Syntax: Axes.get_navigate_mode(self)

Parameters: This method does not accept any parameters.

Return value: This method returns navigation mode.

Below examples illustrate the matplotlib.axes.Axes.get_navigate_mode() function in matplotlib.axes:
Example 1:




# Implementation of matplotlib function
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
    
t = np.arange(0.0, 2, 0.001)
s = 1 + np.sin(8 * np.pi * t)*0.4
    
fig, ax = plt.subplots()
ax.plot(t, s)
  
w = ax.get_navigate_mode()
  
ax.text(0.5, 1.43, "Navigate Mode : " + str(w), 
        fontweight ="bold")
  
ax.set(xlabel ='X-Axis', ylabel ='Y-Axis',
       xlim =(0, 1.5), ylim =(0.5, 1.5))
  
ax.set_title('matplotlib.axes.Axes.get_navigate_mode()\
 function Example', fontweight ="bold")
  
ax.grid()
plt.show()


Output:

Example 2:




# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(19680801)
   
fig, ax = plt.subplots()
   
x, y, s, c = np.random.rand(4, 200)
s *= 200
   
ax.scatter(x, y, s, c)
ax.set_navigate_mode("ZOOM")
w = ax.get_navigate_mode()
  
ax.text(0.3, .65, "Navigate Mode : " + str(w), 
        fontweight ="bold")
  
ax.set_title('matplotlib.axes.Axes.get_navigate_mode()\
 function Example', fontweight ="bold")
  
ax.grid()
plt.show()


Output:

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

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6628 POSTS0 COMMENTS
Nicole Veronica
11799 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11858 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6716 POSTS0 COMMENTS