Skip to content

Commit aa6516f

Browse files
0.26.11 plot title with correct points
1 parent 8ee2e61 commit aa6516f

2 files changed

Lines changed: 5 additions & 2 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.26.10"
10+
version = "0.26.11"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotpython/plot/contour.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def hidden_value(dim_index):
264264
on_mask = np.isclose(z_actual, z_pred_for_point, atol=atol)
265265
below_mask = z_actual - atol / 2.0 < z_pred_for_point
266266
above_mask = z_actual + atol / 2.0 > z_pred_for_point
267+
num_correct = np.count_nonzero(on_mask)
267268

268269
# 2D contour scatter
269270
ax_contour.scatter(
@@ -332,7 +333,9 @@ def hidden_value(dim_index):
332333

333334
# --- Title, save, and show ---
334335
if title:
335-
fig.suptitle(title, fontsize=legend_fontsize + 2)
336+
updated_title = f"{title} Correct Points: {num_correct}"
337+
fig.suptitle(updated_title, fontsize=legend_fontsize + 2)
338+
336339
plt.tight_layout(rect=[0, 0, 1, 0.95])
337340

338341
if filename:

0 commit comments

Comments
 (0)