

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to 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
- Related Questions & Answers
- Annotate Subplots in a Figure with A, B, C using Matplotlib
- How to combine several matplotlib axes subplots into one figure?
- How to have a function return a figure in Python (using Matplotlib)?
- Animation using Matplotlib with subplots and ArtistAnimation
- How to close a Python figure by keyboard input using Matplotlib?
- How to set same scale for subplots in Python using Matplotlib?
- MySQL query to add dots if string has more than 10 words?
- How to zoom subplots together in Matplotlib/Pyplot?
- Draw a border around subplots in Matplotlib
- How to make phone call in iOS 10 using Swift?
- How to add a 3d subplot to a matplotlib figure?
- Change figure size and figure format in Matplotlib
- How to retrieve XY data from a Matplotlib figure?
- How to position and align a Matplotlib figure legend?
- How to set the margins of a Matplotlib figure?
Advertisements