When saving the graph output by the graph plot method that uses matplotlib
internally, the axis label may be cut off.
Since the layout is set in the method, it is difficult to adjust it, but I will write down how to adjust it well.
You can call the tight_layout
method of pylab
(or matplotlib.pylab
).
The graph layout is changed so that the axis labels and memory labels in the graph can be output well.
The following is an example of the shap
module with summary_plot
.
shap summary_Example in plot
shap.summary_plot(shap_values, X, show=False)
pylab.tight_layout()
plt.savefig('./shap.png')
-bbox_inches = "tight" or something like that --virsalus diary
Recommended Posts