How to remove the frame from a Matplotlib figure in Python? Last Updated : 11 Dec, 2020 Comments Improve Suggest changes Like Article Like Report A frame in the Matplotlib figure is an object inside which given data is represented using independent Axes. These axes represent left, bottom, right and top which can be visualized by Spines(lines) and ticks. To remove the frame (box around the figure) in Matplotlib we follow the steps. Here firstly we will plot a 2D figure in Matplotlib by importing the Matplotlib library. Syntax: plt.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False) Approach: Select the axis to be applied. And select the tick by which the parameter are applied generally it can be 'major' , 'minor' or 'both'.Get the current Axex and select the spines' visibility as False. Python3 # Importing the Library import matplotlib.pyplot as plt # Defining X-axis and Y-axis data Points x = [0, 1, 2, 3, 4, 5, 6, 8] y = [1, 5, 2, 8, 3, 5, 2, 7] # Defining the Width and height of the Figure plt.figure(figsize=(8, 7)) plt.plot(x, y) plt.show() Output: The given output contains the frame with the spines and ticks. By means of removing the frame we are actually removing the box around the figure containing axes( left, bottom, right, Top).To remove the spines denoted by Black Lines we can follow the steps, Python3 plt.figure(figsize=(4, 3)) plt.plot(x, y) # Selecting the axis-X making the bottom and top axes False. plt.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False) # Selecting the axis-Y making the right and left axes False plt.tick_params(axis='y', which='both', right=False, left=False, labelleft=False) # Iterating over all the axes in the figure # and make the Spines Visibility as False for pos in ['right', 'top', 'bottom', 'left']: plt.gca().spines[pos].set_visible(False) plt.show() Output: Comment More infoAdvertise with us Next Article How to remove the frame from a Matplotlib figure in Python? C codewithdev Follow Improve Article Tags : Technical Scripter Python Technical Scripter 2020 Python-matplotlib Practice Tags : python Similar Reads Matplotlib.figure.Figure.set_frameon() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 1 min read Matplotlib.figure.Figure.text() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read Matplotlib.figure.Figure.set_canvas() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read Matplotlib.figure.Figure.show() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read Matplotlib.figure.Figure.set_figwidth() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read How to Add Axes to a Figure in Matplotlib with Python? Matplotlib is a library in Python used to create figures and provide tools for customizing it. It allows plotting different types of data, geometrical figures. In this article, we will see how to add axes to a figure in matplotlib. We can add axes to a figure in matplotlib by passing a list argument 2 min read How to Change the Size of Figures in Matplotlib? Matplotlib provides a default figure size of 6.4 inches in width and 4.8 inches in height. While this is suitable for basic graphs, various situations may require resizing figures for better visualization, presentation or publication. This article explores multiple methods to adjust the figure size 3 min read Matplotlib.figure.Figure.get_tightbbox() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read Matplotlib.figure.Figure.set_dpi() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read Matplotlib.figure.Figure.get_frameon() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot 2 min read Like