Skip to content

Commit 3ddac87

Browse files
timtreisclaude
andcommitted
Clean up intermediate variable in render_labels and render_points; update reference images
The _cax intermediate was introduced alongside the now-removed ax.add_image / ax.add_collection calls. With those calls gone, the variable serves no purpose -- rename directly to cax at the scatter / imshow call site. Reference images for visual tests regenerated from CI artifacts to reflect the corrected single-compositing alpha output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6f60e7f commit 3ddac87

10 files changed

Lines changed: 4 additions & 5 deletions

src/spatialdata_plot/pl/render.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ def _render_points(
10161016
elif method == "matplotlib":
10171017
# update axis limits if plot was empty before (necessary if datashader comes after)
10181018
update_parameters = not _mpl_ax_contains_elements(ax)
1019-
_cax = ax.scatter(
1019+
cax = ax.scatter(
10201020
adata[:, 0].X.flatten(),
10211021
adata[:, 1].X.flatten(),
10221022
s=render_params.size,
@@ -1029,7 +1029,6 @@ def _render_points(
10291029
zorder=render_params.zorder,
10301030
plotnonfinite=True, # nan points should be rendered as well
10311031
)
1032-
cax = _cax
10331032
if update_parameters:
10341033
# necessary if points are plotted with mpl first and then with datashader
10351034
extent = get_extent(sdata_filt.points[element], coordinate_system=coordinate_system)
@@ -1721,7 +1720,7 @@ def _draw_labels(
17211720
outline_color=outline_color,
17221721
)
17231722

1724-
_cax = ax.imshow(
1723+
cax = ax.imshow(
17251724
labels,
17261725
rasterized=True,
17271726
cmap=None if categorical else render_params.cmap_params.cmap,
@@ -1730,8 +1729,8 @@ def _draw_labels(
17301729
origin="lower",
17311730
zorder=render_params.zorder,
17321731
)
1733-
_cax.set_transform(trans_data)
1734-
return _cax
1732+
cax.set_transform(trans_data)
1733+
return cax
17351734

17361735
# When color is a literal (col_for_color is None) and no explicit outline_color,
17371736
# use the literal color for outlines so they are visible (e.g., color='white' on
-2.21 KB
Loading
-3.87 KB
Loading
-4.4 KB
Loading
-4.07 KB
Loading
15.4 KB
Loading
4.78 KB
Loading
15.4 KB
Loading
874 Bytes
Loading
-509 Bytes
Loading

0 commit comments

Comments
 (0)