figure():
- matplotlib.figure module used contains Figure class.
- It is used to specify the width and height of Frame in inches.
- fig = plt.figure()
- parameter is to set width and height
- fig_size = (width, height) tuple in inches
subplot(): The function returs the axis of object at the given grid position.
Syntax :
plt.subplot(subplot(nrow, ncols, index))
from matplotlib import pyplot as plt
import numpy as np
x = [10,20,30,40]
y = [30,70,20,10]
plt.figure(figsize=(9,3))
plt.subplot(131)
plt.bar(x,y)
plt.subplot(132)
plt.scatter(x,y)
plt.subplot(133)
plt.plot(x,y)
plt.suptitle("Categorial plot")
plt.show()