python plt.savefig, subplots : 为什么上下图重叠 table
python plt.savefig, subplots : why the upper-bottom figure overlapped with bottom-upper table
我做了一个图&table,下面的图window就可以了,加上constrained_layout=True
后:
但是,当我将图形保存到图片时,table 和图形重叠 plt.savefit("path+fig.png", bbox_index='tight)
。希望有大佬指教,谢谢!
我已经学会了如何避免这种情况(虽然仍然不清楚为什么)
plt.tight_layout()
应该在plt.savefig('path+name.jpg', bbox_inches='tight')
后面,那么views
和tables
就不会重叠了。
- 如果
plt.tight_Layout()
在plt.savefig
之前,我们看到的是functiong只能tight viewes
排除tables
(表格很可能会重叠),plt.savefig()
; 创建的图片也是如此
- 如果我们设置
plt.rcParams['figure.autolayout'] = True
而不是 plt.tight_layout()
,那么 viewes
和 tables
在 figure window
中是可以的,但是 tables
仍然重叠在 plt.savefig()
; 创建的图片中
如果我们移动 plt.savefig()
,
-- plt.tight_layout()
只能缩放viewes
不包括tables
;
-- plt.rcParams['figure.autolayout']=True
可以在figure
window.
中同时缩放viewes
和tables
我做了一个图&table,下面的图window就可以了,加上constrained_layout=True
后:
但是,当我将图形保存到图片时,table 和图形重叠 plt.savefit("path+fig.png", bbox_index='tight)
。希望有大佬指教,谢谢!
我已经学会了如何避免这种情况(虽然仍然不清楚为什么)
plt.tight_layout()
应该在plt.savefig('path+name.jpg', bbox_inches='tight')
后面,那么views
和tables
就不会重叠了。
- 如果
plt.tight_Layout()
在plt.savefig
之前,我们看到的是functiong只能tightviewes
排除tables
(表格很可能会重叠),plt.savefig()
; 创建的图片也是如此
- 如果我们设置
plt.rcParams['figure.autolayout'] = True
而不是plt.tight_layout()
,那么viewes
和tables
在figure window
中是可以的,但是tables
仍然重叠在plt.savefig()
; 创建的图片中
如果我们移动
plt.savefig()
,--
plt.tight_layout()
只能缩放viewes
不包括tables
;--
plt.rcParams['figure.autolayout']=True
可以在figure
window. 中同时缩放
viewes
和tables