【发布时间】:2016-08-10 20:29:03
【问题描述】:
我正在尝试使用以下代码在 How to remove gaps between subplots in matplotlib? 上重现 Thucydides411 的示例:
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(8,8)) # Notice the equal aspect ratio
ax = [fig.add_subplot(2,2,i+1) for i in range(4)]
for a in ax:
a.set_xticklabels([])
a.set_yticklabels([])
a.set_aspect('equal')
fig.subplots_adjust(wspace=0, hspace=0)
plt.show()
由于图形大小具有相等的纵横比,我希望子图之间没有间隙。但是,我看到的是以下内容:
虽然没有垂直间隙,但有一个小的横向间隙。任何想法为什么这不像 Thucydides411 那样有效?
【问题讨论】:
标签: python matplotlib