Open In App

Matplotlib.axes.Axes.set_navigate_mode() in Python

Improve
Improve
Like Article
Like
Save
Share
Report

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

The Axes.set_navigate_mode() Function in axes module of matplotlib library is used to set the navigation toolbar button status.

Syntax: Axes.set_navigate_mode(self, b)

Parameters: This method accept the following parameters.

  • b : This parameter is the navigation mode value.

Return value: This method does not returns any value.

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




# 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")
   
ax.set_title('matplotlib.axes.Axes.set_navigate_mode()\
 function Example', fontweight ="bold")
  
ax.grid()
     
plt.show()


Output:

Example 2:




# 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)
  
ax.set_navigate_mode("PAN")
  
ax.set(xlabel ='X-Axis', ylabel ='Y-Axis'
       xlim =(0, 1.5), ylim =(0.5, 1.5))
  
ax.set_title('matplotlib.axes.Axes.set_navigate_mode()\
 function Example', fontweight ="bold")
  
ax.grid()
plt.show()


Output:



Last Updated : 19 Apr, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads