Matplotlib.pyplot.ginput() in Python Last Updated : 30 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. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc. matplotlib.pyplot.table() Function The ginput() method pyplot module of matplotlib library is used to block call to interact with a figure. Syntax: matplotlib.pyplot.ginput(n=1, timeout=30, show_clicks=True, mouse_add=1, mouse_pop=3, mouse_stop=2) Parameters: This method accept the following parameters that are described below: n : This parameter is the number of mouse clicks to accumulate. timeout : This parameter is the number of seconds to wait before timing out. show_clicks : This parameter is used to show a red cross at the location of each click. mouse_add : This parameter is the Mouse button used to add points. mouse_pop : This parameter is the Mouse button used to remove the most recently added point. mouse_stop : This parameter is the Mouse button used to stop input. Returns: This method return the list of the clicked (x, y) coordinates. Below examples illustrate the matplotlib.pyplot.ginput() function in matplotlib.pyplot: Example 1: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np t = np.arange(10) plt.plot(t, np.sin(t)) plt.title('matplotlib.pyplot.ginput()\ function Example', fontweight ="bold") print("After 3 clicks :") x = plt.ginput(3) print(x) plt.show() Output: After 3 clicks : [(4.460080645161289, 0.5915838985273842), (4.460080645161289, 0.5915838985273842), (4.460080645161289, 0.5915838985273842)] Example 2: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np np.random.seed(10**7) x1 = np.random.rand(103, 53) plt.title('matplotlib.pyplot.ginput() function\ Example', fontweight ="bold") print("After 2 clicks :") plt.imshow(x1) x = plt.ginput(2) print(x) plt.show() Output: After 2 clicks : [(8.443181818181813, 38.90530303030302), (8.443181818181813, 38.90530303030302)] Comment More infoAdvertise with us Next Article Matplotlib.pyplot.ginput() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Matplotlib Pyplot-class Practice Tags : python Similar Reads Matplotlib.pyplot.gci() 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.grid() in Python matplotlib.pyplot.grid() function in Matplotlib is used to toggle the visibility of grid lines in a plot. Grid lines help improve readability of a plot by adding reference lines at major and/or minor tick positions along the axes. Example:Pythonimport matplotlib.pyplot as plt fig, ax = plt.subplots( 3 min read Matplotlib.pyplot.gca() in Python Matplotlib is a library in Python and it is a numerical - mathematical extension for the NumPy library. Pyplot is a state-based interface to a Matplotlib module that provides a MATLAB-like interface.  matplotlib.pyplot.gca() Function The gca() function in pyplot module of matplotlib library is used 2 min read Matplotlib.pyplot.gcf() 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. matplotlib.pyplot.gcf() matplotlib.pyplot.gcf() is primarily used to get the current fi 2 min read matplotlib.pyplot.figure() 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.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.clim() 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.autumn() 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.bone() 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 Like