Question is a figure & table together from different axes.
On the one hand, its fine in figure window shows below, after constrained_layout=True
is added:
On the other hand, the lower-lines and upper-table overlapped after save it to picture. plt.savefit("path+fig.png", bbox_index='tight)
I've learned how to avoid the problem that lines
and tables
overlapped each other.(yet not fully understand)
plt.savefig('path+name.jpg', bbox_inches='tight')
plt.tight_layout()
instead of
plt.tight_layout()
plt.savefig('path+name.jpg', bbox_inches='tight')
plt.tight_Layout()
is before plt.savefig()
, the result is lines
are tight only, excluding tables
(tables very likely will be overlapped), so does the pictures created by plt.savefig()
;plt.rcParams['figure.autolayout'] = True
instead of plt.tight_layout()
. Well, lines
and tables
is fine in the figure window
, however, the tables
are overlapped still in the picture created by plt.savefig()
;plt.savefig()
,
plt.tight_layout()
can only zoom thelines
excludingtables
;
plt.rcParams['figure.autolayout']=True
can zoom both oflines
andtables
in thefigure
window.