我正在尝试保存一个在IPython inline中正常工作的图形,但无法将带有坐标轴和标题的图形保存到磁盘上。
我在matplotlibrc中默认使用TKAgg后端。
这里可能出了什么问题?我已经明确设置了xlabel,并且在IPython inline绘图中刻度标记也正常工作。
我在matplotlibrc中默认使用TKAgg后端。
这里可能出了什么问题?我已经明确设置了xlabel,并且在IPython inline绘图中刻度标记也正常工作。
import matplotlib.pylab as plt
x = [1,2,3,3]
y = map(lambda(x): x * 2, x)
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.set_title("bleh")
ax.set_xlabel("xlabel")
ax.plot(x, y, 'r--')
fig.savefig("fig.png")