Skip to content

Commit f262300

Browse files
committed
Fix plotting bug
1 parent 2917f68 commit f262300

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
repos:
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
# Ruff version.
17-
rev: v0.9.6
17+
rev: v0.9.10
1818
hooks:
1919
# Run the linter.
2020
- id: ruff

bayesflow/diagnostics/plots/z_score_contraction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def z_score_contraction(
121121
ax.scatter(contraction[:, i], z_score[:, i], color=color, alpha=0.5)
122122
ax.set_xlim([-0.05, 1.05])
123123

124-
prettify_subplots(plot_data["axes"], tick_fontsize)
124+
prettify_subplots(plot_data["axes"], num_subplots=plot_data["num_variables"], tick_fontsize=tick_fontsize)
125125

126126
# Add labels, titles, and set font sizes
127127
add_titles_and_labels(

bayesflow/utils/plot_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ def add_y_labels(axes: np.ndarray, num_row: int = None, ylabel: Sequence[str] |
203203

204204

205205
def add_titles(axes: np.ndarray, title: Sequence[str] | str = None, title_fontsize: int = None):
206-
for i, ax in enumerate(axes.flat):
207-
ax.set_title(title[i], fontsize=title_fontsize)
206+
for t, ax in zip(title, axes.flat):
207+
ax.set_title(t, fontsize=title_fontsize)
208208

209209

210210
def add_titles_and_labels(

0 commit comments

Comments
 (0)