Created
March 5, 2012 16:08
-
-
Save smathot/1979042 to your computer and use it in GitHub Desktop.
Matplotlib subplot example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
from matplotlib import pyplot | |
import numpy as np | |
fig = pyplot.figure() | |
xData = np.linspace(0, 4*np.pi) | |
yData = np.sin(xData) | |
# 3 rows, 2 columns, subplot 2 -> 321 | |
pyplot.subplot("321") | |
pyplot.plot(xData, yData) | |
# 3 rows, 2 columns, subplot 2 -> 322 | |
pyplot.subplot("322") | |
pyplot.plot(xData, yData) | |
# 3 rows, 2 columns, subplot 3 -> 323 | |
pyplot.subplot("323") | |
pyplot.plot(xData, yData) | |
# etc ... | |
pyplot.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment