First page Back Continue Last page Overview Graphics

Subplots with gridspec, Part 1

import matplotlib.gridspec as gridspec

import matplotlib.pyplot as pl

pl.figure(figsize=(6, 4))

G = gridspec.GridSpec(3, 3)

axes_1 = pl.subplot(G[0, :])

pl.xticks(())

pl.yticks(())

pl.text(0.5, 0.5, 'Axes 1', ha='center', va='center', size=24, alpha=.5)

axes_2 = pl.subplot(G[1, :-1])

pl.xticks(())

pl.yticks(())

pl.text(0.5, 0.5, 'Axes 2', ha='center', va='center', size=24, alpha=.5)