Skip to content

Commit 34ed9be

Browse files
v0.6.27
plt show options added
1 parent 941cd41 commit 34ed9be

2 files changed

Lines changed: 6 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.6.26"
10+
version = "0.6.27"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/spot/spot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,11 +911,13 @@ def print_importance(self, threshold=0.1, print_screen=True) -> list:
911911
print("Importance requires more than one theta values (n_theta>1).")
912912
return output
913913

914-
def plot_importance(self, threshold=0.1, filename=None, dpi=300) -> None:
914+
def plot_importance(self, threshold=0.1, filename=None, dpi=300, show=True) -> None:
915915
"""Plot the importance of each variable.
916916
Args:
917917
threshold (float): The threshold of the importance.
918918
filename (str): The filename of the plot.
919+
dpi (int): The dpi of the plot.
920+
show (bool): Show the plot. Default is `True`.
919921
Returns:
920922
None
921923
"""
@@ -932,7 +934,8 @@ def plot_importance(self, threshold=0.1, filename=None, dpi=300) -> None:
932934
plt.xticks(range(len(imp[idx])), var_name)
933935
if filename is not None:
934936
plt.savefig(filename, bbox_inches="tight", dpi=dpi)
935-
plt.show()
937+
if show:
938+
plt.show()
936939

937940
def parallel_plot(self, show=True) -> go.Figure:
938941
"""

0 commit comments

Comments
 (0)