【发布时间】:2019-01-15 10:27:14
【问题描述】:
使用 python 2.7x,无法升级,因为我在托管 Windows 系统上。我正在尝试按照此示例合并子图,但返回以下错误:
'AxesSubplot' 对象没有属性 'get_gridspec'
我查看了此处的其他示例,但找不到任何适用于我正在使用的构建(Anaconda 2.7,Spyder IDE)的示例来自:
https://matplotlib.org/tutorials/intermediate/gridspec.html
fig9 = plt.figure(constrained_layout=False)
gs1 = fig9.add_gridspec(nrows=3, ncols=3, left=0.05, right=0.48,
wspace=0.05)
f9_ax1 = fig9.add_subplot(gs1[:-1, :])
f9_ax2 = fig9.add_subplot(gs1[-1, :-1])
f9_ax3 = fig9.add_subplot(gs1[-1, -1])
gs2 = fig9.add_gridspec(nrows=3, ncols=3, left=0.55, right=0.98,
hspace=0.05)
f9_ax4 = fig9.add_subplot(gs2[:, :-1])
f9_ax5 = fig9.add_subplot(gs2[:-1, -1])
f9_ax6 = fig9.add_subplot(gs2[-1, -1])
【问题讨论】:
-
我已将
python和python-3.x标记为这个问题,DavidG 的回答似乎是所有用户都应该了解的问题
标签: python python-3.x python-2.7 matplotlib plot