I read this post and understand that:
plt.show()
resets the plot, so you need to plt.savefig()
before plt.show()
. plt
refers to import matplotlib.pyplot as plt
I wonder if there's way to capture and save the figure when you don't have control about plt.show()
(eg, it's encapsulated).
In my specific case I'm using the shap
package. I do
shap.summary_plot(shap_values, X_pred_all, show=False)
and show=False
doesn't seem to work. The figure still displays.