optbinning
optbinning copied to clipboard
Legend missing in ScorecardMonitoring.psi_plot()
When a PSI plot is generated using the function ScorecardMonitoring.psi_plot() the result is different, depdending on the choice of option savefig.
- If the figure is displayed, e.g., in a jupyter notebook using the option
savefig=None
it contains a legend. - If the figure is saved to disk using the option
savefig='Path/For/Figure.jpg'
the legend is missing.
A fix I used was to set
plt.tight_layout()
before saving the plot to disk.
In my opinion it's desirable that both options for the function produce the same output. The variant with the legend is more illustrative.