我正在尝试保存图像并将其加载到界面的QGraphics视图中。保存的图像始终是木板。任何建议表示赞赏。
results=[]
names=[]
scoring='accuracy'
for name,model in models:
kfold=model_selection.KFold(n_splits=10, random_state=seed)
cv_results=model_selection.cross_val_score(model,X,Y,cv=kfold,scoring=scoring)
results.append(cv_results)
names.append(name)
msg="%s:%f(%f)"%(name,cv_results.mean(),cv_results.std())
#print(msg)
fig=plt.figure()
fig.suptitle('Algoriithm Comparison')
ax=fig.add_subplot(111)
plt.boxplot(results)
ax.set_xticklabels(names)
plt.show()
#self.plt.savefig('f1.png')
fileFormat="PNG"
fileName="ar.png"
def saveImage(self, fileName, fileFormat):
self.plt.save(fileName, fileFormat)