我想使用Matplotlib对我的力图(由shap.plots.force
创建)添加一些修改,例如添加标题、使用紧凑布局等.但是,我try 添加标题,但标题没有显示.知道为什么以及如何使用Matplotlib添加标题吗?
import numpy as np
import shap
import matplotlib.pyplot as plt
myBaseline=1.5
shap_values_0 = np.array([-1, -4, 3])
test_point_0 = np.array([11, 12, 13])
features_names = ['a1','a2','a3']
shap.plots.force(myBaseline,shap_values_0,test_point_0,features_names,matplotlib = 1)
plt.suptitle("This is my title") # It doesn't show up, why?
fig = plt.gcf()
fig.canvas.draw()
plt.close()