×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

Python | Enable / Disable Frame on Figure

In this article, we are going to learn how to enable / disable frame on figure in Python?
Submitted by Anuj Singh, on August 14, 2020

Illustration:

Enable / Disable Frame on Figure (1)

Enable / Disable Frame on Figure (2)

Python code for enable / disable frame on figure

import matplotlib.pyplot as plt
import numpy as np

dt = 2
x = np.arange(-50.0, 50.0, dt)
y = np.arange(0, 100.0, dt)

plt.figure(frameon=False)
plt.plot(y, x, 'o', color='purple')
plt.ylabel('figure without Farmeon')
plt.grid()

plt.figure(frameon=True)
plt.plot(y, x, 'o', color='purple')
plt.ylabel('figure with Farmeon')
plt.grid()
plt.show()

Output:

Output is as Figure
Advertisement
Advertisement


Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.