1import numpy as np
2import matplotlib.pyplot as plt
3
4# generate some data
5x = np.arange(0, 10, 0.2)
6y = np.sin(x)
7
8# plot it
9f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
10a0.plot(x, y)
11a1.plot(y, x)
12
13f.tight_layout()
14f.savefig('grid_figure.pdf')