Friday, January 23, 2026
HomeLanguagesMatplotlib.axes.Axes.start_pan() in Python

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

The Axes.start_pan() function in axes module of matplotlib library is called when a pan operation has started. 

Syntax: Axes.start_pan(self, x, y, button)
Parameters: This method accept the following parameters that are described below: 

  • x, y: These parameter are the mouse coordinates in display coords.
  • button: This parameter is the mouse button number: 
    • 1: LEFT
    • 2: MIDDLE
    • 3: RIGHT

Returns: This methods does not return any value. 
 

Below examples illustrate the matplotlib.axes.Axes.start_pan() function in matplotlib.axes:

Example 1:  

Python3




# Implementation of matplotlib function
import matplotlib.pyplot as plt
import numpy as np
  
np.random.seed(10**7)
data = np.random.normal(0, 5, 100)
  
fig, ax1 = plt.subplots()
val = ax1.violinplot(data)
ax1.start_pan(1, 0, 3)
   
ax1.set_title('matplotlib.axes.Axes.start_pan() Example')
plt.show()


Output: 

Example 2: 

Python3




# Implementation of matplotlib function
import matplotlib.pyplot as plt
import numpy as np
   
neveropen = np.array([24.40, 110.25, 20.05,
                  22.00, 61.90, 7.80,
                  15.00, 22.80, 34.90,
                  57.30])
   
fig, ax = plt.subplots()
ax.acorr(neveropen, maxlags = 9)
 
ax.set_ylabel('Y-axis')
ax.start_pan(0, 0.6, 1)
   
ax.set_title('matplotlib.axes.Axes.start_pan() Example')
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
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12065 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7221 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS