CHAPTER 05 · 作品已接入
自定义区域
用 GridSpec 自由组合不同尺寸的子图区域。
import matplotlib.pyplot as plt
fig = plt.figure()
gs = fig.add_gridspec(2, 2, width_ratios=[1, 2])
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[:, 1])
plt.show()
CHAPTER 05 · 作品已接入
用 GridSpec 自由组合不同尺寸的子图区域。
import matplotlib.pyplot as plt
fig = plt.figure()
gs = fig.add_gridspec(2, 2, width_ratios=[1, 2])
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[:, 1])
plt.show()