Skip to content

Commit d0e8cc1

Browse files
0.24.14
plot mo
1 parent a19aa96 commit d0e8cc1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.28.13"
10+
version = "0.28.14"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotpython/mo/plot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ def plot_mo(
137137
plt.ylabel(target_names[j])
138138
plt.grid()
139139
plt.title(title)
140-
plt.legend()
140+
# Move the legend outside the plot
141+
plt.legend(loc="center left", bbox_to_anchor=(1, 0.5))
141142
# Save or show the plot
142143
if filename:
143144
if filename.endswith(".pdf") or filename.endswith(".png"):
144-
plt.savefig(filename, format=filename.split(".")[-1])
145+
plt.savefig(filename, format=filename.split(".")[-1], bbox_inches="tight")
145146
else:
146147
raise ValueError("Filename must have a valid suffix: '.pdf' or '.png'.")
147148
else:

0 commit comments

Comments
 (0)