📜  matplotlib 多个不同大小的图 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:33.146000             🧑  作者: Mango

代码示例1
import numpy as np
import matplotlib.pyplot as plt 

# generate some data
x = np.arange(0, 10, 0.2)
y = np.sin(x)

# plot it
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
a0.plot(x, y)
a1.plot(y, x)

f.tight_layout()
f.savefig('grid_figure.pdf')