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





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.