Skip to content

Commit 7c38e95

Browse files
authored
Update report.py
When feature names are long like the ones from egemaps (e.g., "logRelF0-H1-H2_sma3nz_stddevNorm") the y-axis will not fit and `tight_layout` is not applied. Instead, `bbox_inches='tight'` plots correctly.
1 parent a44e535 commit 7c38e95

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pydra_ml/report.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ def plot_summary(summary, output_dir=None, filename="shap_plot", plot_top_n_shap
4040
hm.set_xticklabels(summary.columns, rotation=45)
4141
hm.set_yticklabels(summary.index, rotation=0)
4242
plt.ylabel("Features")
43-
plt.tight_layout()
4443
plt.show(block=False)
45-
plt.savefig(output_dir + f"summary_{filename}.png", dpi=100)
44+
plt.savefig(output_dir + f"summary_{filename}.png", dpi=100, bbox_inches='tight')
4645

4746

4847
def shaps_to_summary(

0 commit comments

Comments
 (0)