figures and subplots first things first the base of any matplotlib style visualization begins with figure and subplot objects the figure module helps matplotlib generate the plotting window object and its associated elements in shortit is the top-level container for all visualization components in matplotlib syntaxa figure is the top-most container andwithin one figurewe have the flexibility to visualize multiple plots thussubplots are the plots within the high-level figure container let' get started with simple example and the required imports we will then build on the example to better understand the concept of figure and subplots the following snippet imports the pyplot module of matplotlib and plots simple sine curve using numpy to generate and values import numpy as np import matplotlib pyplot as plt sample plot np linspace(- =np sin(xplt plot( ,yplt title('sine curve using matplotlib'plt xlabel(' -axis'plt ylabel(' -axis'the pyplot module exposes methods such as plot(to generate visualizations in the examplewith plt plot(xy)matplotlib is working behind the scenes to generate the figure and axes objects to output the plot in figure - for completenesssakethe statements plt title()plt xlabel()and so on provide ways to set the figure title and axis labelsrespectively figure - sample plot