python - 为什么我的 matplotlib 子图水平距离不会变小?wspace 无功能
问题描述
我似乎无法缩小两列之间的距离,而 subplots.adjust 函数似乎不允许它变小。我已经使用 hspace 和 wspace 命令来尝试强制它,但是它似乎不起作用。我有
fig, axs = plt.subplots(4, 2, dpi=300)
fontprops = fm.FontProperties(size=6,weight='bold')
for i in range((4)):
for j in range(2):
axs[i][j].set_yticks([])
axs[i][j].set_xticks([])
axs[0,0].imshow(ITO10_Dimer1SI_Linear_Norm,cmap=ice_map1)
axs[0,0].text(38,4,'565 meV', color='w',fontsize=6,fontweight='bold')
axs[1,0].imshow(ITO10_Dimer1SI_Parallel_Norm,cmap=ice_map1)
axs[1,0].text(38,4,'785 meV', color='w',fontsize=6,fontweight='bold')
axs[2,0].imshow(ITO10_Dimer1SI_aParallel_Norm,cmap=ice_map1)
axs[2,0].text(38,4,'910 meV', color='w',fontsize=6,fontweight='bold')
axs[3,0].imshow(ITO10_Dimer1SI_aLinear_Norm,cmap=ice_map1)
axs[3,0].text(38,4,'970 meV', color='w',fontsize=6,fontweight='bold')
axs[0,1].imshow(BondIP_Norm,cmap='hot')
axs[1,1].imshow(ParaIP_Norm,cmap='hot')
axs[2,1].imshow(ParaOP_Norm,cmap='hot')
axs[3,1].imshow(BondOP_Norm,cmap='hot')
plt.subplots_adjust(hspace=0.05,wspace=0.5)
plt.show()
解决方案
推荐阅读
- python - 即使只有一个类,有没有办法建立逻辑回归模型?
- android-viewpager - ViewPager2 - onBindViewHolder 被调用两次
- android - 如何为房间数据库中的嵌套对象创建实体类
- javascript - 使用深度优先搜索算法的无限循环误差
- node.js - 如何使用现有变量构建 Graqhql 突变
- gcc - gcc 的 VC++ 编译器选项 /Oi 等效项是什么?
- python - pyqt5界面背景添加图片
- pandas - Pandas 添加了一个汇总列,用于计算非空字符串的值
- javascript - Node.JS“未捕获的 TypeError:util.TextEncoder 不是构造函数”
- mongodb - Mongo 是否首先搜索索引字段?