我有下面这段代码,不起作用:
可以看到,fig.subplots_adjust根本不起作用。 我正在使用WinPython 3.3.2.3 64位版本,matplotlib版本为1.3.0和CPython 3.3。 这在IPython Notebook中发生。 后端是内联的。 笔记本电脑的输出完整,但输出文件未正确裁剪。 在笔记本和保存的文件中,subplots_adjust命令没有效果。
我有以下代码没有起作用:
import matplotlib.pyplot as plt
# Make the plot
fig, axs = plt.subplots(3, 1, figsize=(3.27, 6))
axs[0].plot(range(5), range(5), label='label 1')
axs[0].plot(range(5), range(4, -1, -1), label='label 2')
axs[0].legend(bbox_to_anchor=(0, 1.1, 1., 0.1), mode='expand', ncol=2, frameon=True, borderaxespad=0.)
# Adjust subplots to make room
fig.subplots_adjust(top=.5)
fig.savefig('test.png', format='png', dpi=300)
可以看到,fig.subplots_adjust根本不起作用。 我正在使用WinPython 3.3.2.3 64位版本,matplotlib版本为1.3.0和CPython 3.3。 这在IPython Notebook中发生。 后端是内联的。 笔记本电脑的输出完整,但输出文件未正确裁剪。 在笔记本和保存的文件中,subplots_adjust命令没有效果。
pyplot
之前调用了use
吗? - tacaswell