Skip to content

Commit c1d8f53

Browse files
Jammy2211claude
authored andcommitted
feat: add title_prefix to subplot_of_mapper; rename Unzoomed panels
All panel titles in subplot_of_mapper now receive the title_prefix (with auto-space). Also renames: "Noise-Map (Unzoomed)" -> "Noise-Map (No Zoom)" "Regularization Weights (Unzoomed)" -> "Regularization (No Zoom)" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f27226c commit c1d8f53

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

autoarray/inversion/plot/inversion_plots.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def subplot_of_mapper(
2727
lines=None,
2828
grid=None,
2929
positions=None,
30+
title_prefix: str = None,
3031
):
3132
"""
3233
3×4 subplot showing all pixelization diagnostics for one mapper.
@@ -52,6 +53,8 @@ def subplot_of_mapper(
5253
"""
5354
mapper = inversion.cls_list_from(cls=Mapper)[mapper_index]
5455

56+
_pf = (lambda t: f"{title_prefix.rstrip()} {t}") if title_prefix else (lambda t: t)
57+
5558
fig, axes = subplots(3, 4, figsize=conf_subplot_figsize(3, 4))
5659
axes = axes.flatten()
5760

@@ -60,7 +63,7 @@ def subplot_of_mapper(
6063
plot_array(
6164
inversion.data_subtracted_dict[mapper],
6265
ax=axes[0],
63-
title="Data Subtracted",
66+
title=_pf("Data Subtracted"),
6467
colormap=colormap,
6568
use_log10=use_log10,
6669
grid=grid,
@@ -83,7 +86,7 @@ def _recon_array():
8386
plot_array(
8487
_recon_array(),
8588
ax=axes[1],
86-
title="Reconstructed Image",
89+
title=_pf("Reconstructed Image"),
8790
colormap=colormap,
8891
use_log10=use_log10,
8992
grid=grid,
@@ -93,7 +96,7 @@ def _recon_array():
9396
plot_array(
9497
_recon_array(),
9598
ax=axes[2],
96-
title="Reconstructed Image (log10)",
99+
title=_pf("Reconstructed Image (log10)"),
97100
colormap=colormap,
98101
use_log10=True,
99102
grid=grid,
@@ -103,7 +106,7 @@ def _recon_array():
103106
plot_array(
104107
_recon_array(),
105108
ax=axes[3],
106-
title="Mesh Pixel Grid Overlaid",
109+
title=_pf("Mesh Pixel Grid Overlaid"),
107110
colormap=colormap,
108111
use_log10=use_log10,
109112
grid=numpy_grid(mapper.image_plane_mesh_grid),
@@ -123,7 +126,7 @@ def _recon_array():
123126
mapper,
124127
solution_vector=pixel_values,
125128
ax=axes[4],
126-
title="Source Plane (Zoom)",
129+
title=_pf("Source Plane (Zoom)"),
127130
colormap=colormap,
128131
use_log10=use_log10,
129132
vmax=recon_vmax,
@@ -135,7 +138,7 @@ def _recon_array():
135138
mapper,
136139
solution_vector=pixel_values,
137140
ax=axes[5],
138-
title="Source Plane (No Zoom)",
141+
title=_pf("Source Plane (No Zoom)"),
139142
colormap=colormap,
140143
use_log10=use_log10,
141144
vmax=recon_vmax,
@@ -151,7 +154,7 @@ def _recon_array():
151154
mapper,
152155
solution_vector=nm,
153156
ax=axes[6],
154-
title="Noise-Map (Unzoomed)",
157+
title=_pf("Noise-Map (No Zoom)"),
155158
colormap=colormap,
156159
use_log10=use_log10,
157160
zoom_to_brightest=False,
@@ -168,7 +171,7 @@ def _recon_array():
168171
mapper,
169172
solution_vector=rw,
170173
ax=axes[7],
171-
title="Regularization Weights (Unzoomed)",
174+
title=_pf("Regularization (No Zoom)"),
172175
colormap=colormap,
173176
use_log10=use_log10,
174177
zoom_to_brightest=False,
@@ -186,7 +189,7 @@ def _recon_array():
186189
plot_array(
187190
sub_size,
188191
ax=axes[8],
189-
title="Sub Pixels Per Image Pixels",
192+
title=_pf("Sub Pixels Per Image Pixels"),
190193
colormap=colormap,
191194
use_log10=use_log10,
192195
)
@@ -198,7 +201,7 @@ def _recon_array():
198201
plot_array(
199202
mapper.mesh_pixels_per_image_pixels,
200203
ax=axes[9],
201-
title="Mesh Pixels Per Image Pixels",
204+
title=_pf("Mesh Pixels Per Image Pixels"),
202205
colormap=colormap,
203206
use_log10=use_log10,
204207
)
@@ -212,7 +215,7 @@ def _recon_array():
212215
mapper,
213216
solution_vector=pw,
214217
ax=axes[10],
215-
title="Image Pixels Per Source Pixel",
218+
title=_pf("Image Pixels Per Source Pixel"),
216219
colormap=colormap,
217220
use_log10=use_log10,
218221
zoom_to_brightest=True,

0 commit comments

Comments
 (0)