【发布时间】:2020-05-09 13:35:03
【问题描述】:
我有一个问题,Python 在底部子图中将数据集绘制为“ax1”,而不是在任何地方绘制“ax2”数据,从而使顶部子图为空白。
任何帮助表示赞赏!
fig, (ax1, ax2) = plt.subplots(2, sharex=True)
fig.suptitle('Sea Surface pCO2 (ppmv)')
ax1 = ax1.plot(interp_bathy.where(interp_bathy > 0).plot(cmap=cm.topo, vmin = -4000, vmax = 4000, add_colorbar=False),interp_pco2_pre.where(interp_bathy >-120).where(interp_bathy <0).plot(levels=np.arange(200,501,10), cmap=cm.thermal, cbar_kwargs = {'label':'Sea surface pCO2 (ppmv)'}))
ax2 = ax2.plot(interp_bathy.where(interp_bathy > 0).plot(cmap=cm.topo, vmin = -4000, vmax = 4000, add_colorbar=False),interp_pco2_pd.where(interp_bathy >-120).where(interp_bathy <0).plot(levels=np.arange(200,501,10), cmap=cm.thermal, cbar_kwargs = {'label':'Sea surface pCO2 (ppmv)'}))
【问题讨论】: