In [16]:
%matplotlib inline
import matplotlib.pyplot as plt
from random import randint
In [17]:
def generate_data(x=10,ran=9):
raw = (randint(0,ran) for _ in range(x))
return zip(*enumerate(raw))
In [18]:
fig = plt.figure(figsize=(17,9))
ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212)
x, y = generate_data()
ax1.plot(x,y)
x, y = generate_data()
ax2.plot(x,y)
plt.show()
In [19]:
fig = plt.figure(figsize=(17,9))
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
ax3 = fig.add_subplot(212)
x, y = generate_data()
ax1.plot(x,y)
x, y = generate_data()
ax2.plot(x,y)
x, y = generate_data()
ax3.plot(x,y)
plt.show()
In [20]:
fig = plt.figure(figsize=(17,9))
ax1 = plt.subplot2grid((6,1),(0,0),rowspan=1,colspan=1)
ax2 = plt.subplot2grid((6,1),(1,0),rowspan=4,colspan=1)
ax3 = plt.subplot2grid((6,1),(5,0),rowspan=1,colspan=1)
x, y = generate_data()
ax1.plot(x,y)
x, y = generate_data()
ax2.plot(x,y)
x, y = generate_data()
ax3.plot(x,y)
plt.show()