more than 9 subplots in matplotlib

PythonChartsMatplotlib

Python Problem Overview


Is it possible to get more than 9 subplots in matplotlib?

I am on the subplots command pylab.subplot(449); how can I get a 4410 to work?

Thank you very much.

Python Solutions


Solution 1 - Python

It was easier than I expected, I just did: pylab.subplot(4,4,10) and it worked.

Solution 2 - Python

You can also do it like this with pyplot:

import matplotlib.pyplot as plt
oFig1 = plt.figure(1)

oFig1.add_subplot(4,4,11)      #(m,n,x) -> x starts with 1
...

Solution 3 - Python

You could also do

import matplotlib.pyplot as plt

N = 10 # number of subplots you want
fig, axes = plt.subplots(nrows = N)

Then len(axes) = N, meaning you'll have an axis for each subplot to work with.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrelimaView Question on Stackoverflow
Solution 1 - PythonrelimaView Answer on Stackoverflow
Solution 2 - PythonRomanView Answer on Stackoverflow
Solution 3 - Pythonm13op22View Answer on Stackoverflow