Matplotlib.pyplot.rc_context() 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.rc_context() Function The rc_context() function in pyplot module of matplotlib library is used to return a context manager for managing rc settings. Syntax: matplotlib.pyplot.rc_context(rc=None, fname=None) Parameters: rc: This parameter is a dictionary can also be passed to the context manager. fname: This parameter contains the name of file which is to be called. Returns: This method return a context manager for managing rc settings. Below examples illustrate the matplotlib.pyplot.rcdefaults() function in matplotlib.pyplot: Example 1: Python3 1== # implementation of the matplotlib function import matplotlib.pyplot as plt import numpy as np np.random.seed(19680801) dots = np.arange(20) x, y = np.meshgrid(dots, dots) data = [x.ravel(), y.ravel()] with plt.rc_context({'axes.xmargin': .2, 'axes.ymargin': .4}): plt.scatter(*data, c = data[1]) plt.grid(True) plt.title('matplotlib.pyplot.rc_context()\ Example') plt.show() Output: Example 2: Python3 1== # implementation of the matplotlib function import matplotlib.pyplot as plt import numpy as np np.random.seed(19680801) fig, ax = plt.subplots() dots = np.arange(100) x, y = np.meshgrid(dots, dots) data = [x.ravel(), y.ravel()] ax.scatter(*data, c = data[1]) with plt.rc_context({'axes.autolimit_mode': 'round_numbers', 'axes.xmargin': .8, 'axes.ymargin': .8}): fig, ax = plt.subplots() ax.scatter(*data, c = data[1]) plt.grid(True) plt.title('matplotlib.pyplot.rc_context() Example') plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.pyplot.rc_context() 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.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 Matplotlib.pyplot.rc() 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.rc() matplotlib.pyplot.rc() function is used to the rc params. Groupin 3 min read Matplotlib.pyplot.disconnect() 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.disconnect() Function The disconnect() function in pyplot module of matplotlib library 2 min read Matplotlib.pyplot.hot() 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.hot() Function The hot() function in pyplot module of matplotlib library is used to set 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.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.contourf() 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.contourf() Function The contourf() function in pyplot module of matplotlib library is u 2 min read Matplotlib.pyplot.sci() 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.annotate() 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.annotate() Function The annotate() function in pyplot module of matplotlib library is u 3 min read Like