Data-Science-Regular-Bootcamp icon indicating copy to clipboard operation
Data-Science-Regular-Bootcamp copied to clipboard

SubPlot In MatplotLib

Open imsanjoykb opened this issue 3 years ago • 0 comments

import matplotlib.pyplot as plt
# plot a line, implicitly creating a subplot(111)
plt.plot([1,2,3])
# now create a subplot which represents the top plot of a grid with 2 rows and 1 column.
#Since this subplot will overlap the first, the plot (and its axes) previously 
created, will be removed
plt.subplot(211)
plt.plot(range(12))
plt.subplot(212, facecolor='y') # creates 2nd subplot with yellow background
plt.plot(range(12))

imsanjoykb avatar Feb 05 '22 17:02 imsanjoykb