
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Make More Than 10 Subplots in a Figure Using Matplotlib
To make more than 10 subplots in a figure, we can use subplots() method with some rows and columns.
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Initialize rows count and columns count.
- Create a figure and a set of subplots with rows?cols subplots.
- To display the figure, use show() method.
Example
from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True rows = 4 cols = 3 fig, axes = plt.subplots(nrows=rows, ncols=cols) plt.show()
Output
Advertisements