Matplotlib.pyplot.sci() in Python Last Updated : 19 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.sci() Function The sci() function in pyplot module of matplotlib library is used to set the current image. Syntax: matplotlib.pyplot.sci(im) Parameters: im: This image will be the target of colormap functions. Returns: This method does not return any value. Below examples illustrate the matplotlib.pyplot.sci() function in matplotlib.pyplot: Example 1: Python3 1== import matplotlib.pyplot as plt from matplotlib.collections import LineCollection from matplotlib import colors as mcolors import numpy as np N = 50 x = np.arange(N) ys = [x + i for i in x] fig, ax = plt.subplots() ax.set_xlim(0, 20) ax.set_ylim(0, 20) line_segments = LineCollection([np.column_stack([x, y]) for y in ys], linewidths =(0.5, 1, 1.5, 2), linestyles ='dashed', color ="#eeffdd") line_segments.set_array(1/(x + 1)) ax.add_collection(line_segments) line_segments.set_array(x) plt.sci(line_segments) plt.title('matplotlib.pyplot.sci() Example') plt.show() Output: Example 2: Python3 1== import matplotlib.pyplot as plt from matplotlib.collections import EventCollection from matplotlib.collections import LineCollection import numpy as np np.random.seed(19680801) xvalue = np.random.random([2, 10]) xvalue1 = xvalue[0, :] xvalue2 = xvalue[1, :] xvalue1.sort() xvalue2.sort() yvalue1 = xvalue1 ** 4 yvalue2 = 1 - xvalue2 ** 6 fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot(xvalue1, yvalue1, color ='tab:blue') ax.plot(xvalue2, yvalue2, color ='tab:green') xresult1 = EventCollection(xvalue1, color ='tab:blue') yresult1 = EventCollection(yvalue1, color ='tab:blue', orientation ='vertical') ax.add_collection(xresult1) ax.add_collection(yresult1) plt.sci(xresult1) plt.title('matplotlib.pyplot.sci() Example') plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.pyplot.sci() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.pyplot.sca() 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 Matplotlib.pyplot.xlim() 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.show() 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. Sample Code - Python3 1== # sample code import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 2 min read Matplotlib.pyplot.ylim() 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.ylim() Function The ylim() function in pyplot module of matplotlib library is used to g 2 min read Matplotlib.pyplot.twiny() 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. Sample Code Python3 1== # sample code import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 8 2 min read Matplotlib.pyplot.twinx() 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. Sample Code Python3 1== # sample code import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 8 2 min read Matplotlib.pyplot.specgram() 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.specgram() Function The specgram() function in pyplot module of matplotlib library is u 3 min read Matplotlib.pyplot.semilogx() in Python Data Visualization Is an important part of analyzing the data as plotting graphs helps in providing better insight and understanding of the problem. Matplotlib.pyplot is one of the most commonly used libraries to do the same. It helps in creating attractive data and is super easy to use. Matplotlib 8 min read Matplotlib.pyplot.yticks() 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.yticks() Function The annotate() function in pyplot module of matplotlib library is use 2 min read Matplotlib.pyplot.quiver() in Python Matplotlib is a library of Python bindings which provides the user with a MATLAB-like plotting framework. Matplotlib can be used in Python scripts, the Python and IPython shell, web application servers, and various graphical user interface toolkits like Tkinter, awxPython, etc. Matplotlib.pyplot.qui 2 min read Like