嘿,我試圖拯救我的情節,但它總是切斷我的標題。 我認爲這是因爲y = 1.05(設置與標題的距離)。 我無法修復它。有沒有辦法保存整個圖形?Python:Savefig切斷標題
time=round(t[time_period],0)
most_sensitive=sorted(most_sensitive)
plt.figure(figsize=(10, 5))
plt.suptitle("Scatterplot "+str(name)+" , "+r'$\Delta$'+"Output , Zeit= "+str(time)+" s",fontsize=20,y=1.05)
figure_colour=["bo","ro","go","yo"]
for i in [1,2,3,4]:
ax=plt.subplot(2,2,i)
plt.plot(parm_value[:,most_sensitive[i-1]], Outputdiff[:,most_sensitive[i-1]],figure_colour[i-1])
ax.set_xlabel(name+"["+str(most_sensitive[i-1])+"] in "+str(unit))
ax.set_ylabel(r'$\Delta$'+"Output")
lb, ub = ax.get_xlim()
ax.set_xticks(np.linspace(lb, ub, 4))
lb, ub = ax.get_ylim()
ax.set_yticks(np.linspace(lb, ub, 8))
ax.grid(True)
plt.tight_layout()
newpath = r'C:/Users/Tim_s/Desktop/Daten/'+str(name)+'/'+str(time)+'/'+'scatterplot'+'/'
if not os.path.exists(newpath):
os.makedirs(newpath)
savefig(newpath+str(name)+'.png')
請按照[最小的,完整的和可驗證的示例](http://stackoverflow.com/help/MCVE)。按照現狀,重要的代碼丟失或者從屏幕截圖中查看問題是不可能的。 –