Matplotlib.axes.Axes.drag_pan() in Python Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like 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.drag_pan() Function The Axes.drag_pan() function in axes module of matplotlib library is called when the mouse moves during a pan operation. Syntax: Axes.drag_pan(self, button, key, x, y)Parameters: This method accept the following parameters that are described below: x, y: These parameter are the mouse coordinates in display coords.key : This parameter is the "shift" key.button: This parameter is the mouse button number: 1: LEFT2: MIDDLE3: RIGHT Returns: This methods does not return any value. Below examples illustrate the matplotlib.axes.Axes.drag_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.drag_pan(1, "shift", 0, 0.6) ax1.set_title('matplotlib.axes.Axes.drag_pan() Example') plt.show() Output: Example 2: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np geeks = 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(geeks, maxlags = 9) ax.set_ylabel('Y-axis') ax.start_pan(0, 0.6, 1) ax.drag_pan(1, "shift", 0, 0.6) ax.set_title('matplotlib.axes.Axes.drag_pan() Example') plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.axes.Axes.drag_pan() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.axes.Axes.end_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. 1 min read matplotlib.axes.Axes.can_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. 2 min read Matplotlib.axes.Axes.draw() 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. 2 min read Matplotlib.axes.Axes.cla() 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. 1 min read Matplotlib.axes.Axes.get_frame_on() 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. 2 min read Like