How to show an Axes Subplot in Python?


To show an axes subplot in Python, we can use show() method. When multiple figures are created, then those images are displayed using show() method.

Steps

  • Create x and y data points using numpy.
  • Plot x and y using plot() method.
  • To display the figure, use show() method.

Example

from matplotlib import pyplot as plt
import numpy as np
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
x = np.arange(10)
y = np.exp(x)
plt.plot(x, y)
plt.show()

Output

Updated on: 07-May-2021

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements