matplotlib 减少subplot空白

调整前:

...
fig = Figure(figsize=(width, height))
self.ax1 = fig.add_subplot(311)
self.ax2 = fig.add_subplot(312)
self.ax3 = fig.add_subplot(313)
...

matplotlib 减少subplot空白_第1张图片

调整后:

...
fig = Figure(figsize=(width, height))
self.ax1 = fig.add_subplot(311)
self.ax2 = fig.add_subplot(312)
self.ax3 = fig.add_subplot(313)
fig.set_tight_layout(True)# fig.tight_layout()会出现警告
...

matplotlib 减少subplot空白_第2张图片

你可能感兴趣的:(Python,CAN上位机)