Matplotlib.pyplot.disconnect() in Python Last Updated : 21 Apr, 2020 Comments Improve Suggest changes Like Article Like Report Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.disconnect() Function The disconnect() function in pyplot module of matplotlib library is used to disconnect the callback with id cid. Syntax: matplotlib.pyplot.disconnect(cid) Parameters: This method accept the following parameters that are described below: cid: This parameter is used to disconnect the callback. Below examples illustrate the matplotlib.pyplot.disconnect() function in matplotlib.pyplot: Example #1: Python3 1== # Implementation of matplotlib function import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot(np.random.rand(10)) def onclick(event): print('% s click: button =% d, x =% d, y =% d,\ xdata =% f, ydata =% f' % ('double' if event.dblclick else 'single', event.button, event.x, event.y, event.xdata, event.ydata)) cid = fig.canvas.mpl_connect('button_press_event', onclick) fig.canvas.mpl_disconnect(cid) plt.suptitle('matplotlib.pyplot.disconnect()\ function Example', fontweight ="bold") plt.show() Output: Example #2: Python3 1== # Implementation of matplotlib function from matplotlib.backend_bases import MouseButton import matplotlib.pyplot as plt import numpy as np t = np.arange(0.0, 1.0, 0.01) s = np.sin(2 * np.pi * t) fig, ax = plt.subplots() ax.plot(t, s) def gfg1(event): # get the x and y pixel coords x, y = event.x, event.y if event.inaxes: # the axes instance ax = event.inaxes print('Coordinates : % f and\ % f' % (event.xdata, event.ydata)) def gfg2(event): if event.button is MouseButton.LEFT: print('Successfully disconnected') plt.disconnect(binding_id) binding_id = plt.connect('motion_notify_event', gfg1) plt.connect('button_press_event', gfg2) plt.suptitle('matplotlib.pyplot.disconnect()\ function Example', fontweight ="bold") plt.show() Output: Figure shown Background result after click on figure Comment More infoAdvertise with us Next Article Matplotlib.pyplot.disconnect() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.pyplot.connect() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.connect() Function This method is used to connect an event with string s to a function. 3 min read Matplotlib.pyplot.close() in Python Matplotlib close() function in pyplot module of the matplotlib library is used to close a figure window. This function is designed to close a figure window or a set of figure windows. When called without any arguments, it closes the currently active figure. Alternatively, we can pass a figure number 3 min read Matplotlib.pyplot.rc_context() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.ion() in Python Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. The matplotlib.pyplot.ion() is used to turn on interactive mode. To check the status of 4 min read Matplotlib.pyplot.axis() in Python axis() function in Matplotlib is used to get or set properties of the x- and y-axis in a plot. It provides control over axis limits, aspect ratio and visibility, allowing customization of the plotâs coordinate system and view. It's key feature includes:Gets or sets the axis limits [xmin, xmax, ymin, 3 min read Matplotlib.pyplot.ginput() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.cool() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.cool() Function The cool() function in pyplot module of matplotlib library is used to s 2 min read Matplotlib.pyplot.copper() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.copper() Function The copper() function in pyplot module of matplotlib library is used 2 min read matplotlib.pyplot.axhline() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.axhline() Function The axhline() function in pyplot module of matplotlib library is use 2 min read Matplotlib.pyplot.cla() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 1 min read Like