×

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 | Plotting in Plane Figure

Python | Plotting in Plane Figure: In this tutorial, we will learn how to plot in a plane figure i.e., a figure with no axis and no ticks? By Anuj Singh Last updated : August 18, 2023

Plotting in Plane Figure

It helps in looking good and therefore matplotlib has provided this feature with the help of matplotlib.pyplot.axis(False) function.

Examples

Python | Plotting in Plane Figure (1) Python | Plotting in Plane Figure (2) Python | Plotting in Plane Figure (3) Python | Plotting in Plane Figure (4)

Python program for plotting in plane figure

import numpy as np
import matplotlib.pyplot as plt

an = np.linspace(0, 2*np.pi, 100)
plt.figure()
plt.plot(3*np.cos(an), 3*np.sin(an))
plt.box()
plt.axis(False)
plt.show()

plt.figure()
plt.plot(np.arange(25), np.random.randint(45,60,25), 'o-', color='purple')
plt.box()
plt.axis(False)
plt.show()

plt.figure()
plt.bar(np.arange(25), np.random.randint(45,60,25), color='purple', alpha=0.6)
plt.box()
plt.axis(False)
plt.show()

plt.figure()
plt.arrow(0.3, 0.4, 0.3, 0, head_width=0.05, head_length=0.07)
plt.text(0.25, 0.375, 'A', fontsize=18)
plt.text(0.7, 0.375, 'B', fontsize=18)
plt.box()
plt.axis(False)
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.