![]() |
VOOZH | about |
Matplotlib is the most popular Python library for plotting graphs and visualizing our data. In Matplotlib we can create multiple plots by calling them once. To create multiple plots we use the subplot function of pyplot module in Matplotlib.
Syntax: plt.subplot(nrows, .ncolumns, index)
Parameters:
- nrows is for number of rows means if the row is 1 then the plots lie horizontally.
- ncolumns stands for column means if the column is 1 then the plot lie vertically.
- and index is the count/index of plots. It starts with 1.
Approach:
Example 1:
Output:
Example 2: In vertical form.
Output:
To increase the size of the plots we can write like this
plt.subplots(figsize(l, b))
Example 3: