Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/spatialdata_plot/pl/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ def _render_points(
elif method == "matplotlib":
# update axis limits if plot was empty before (necessary if datashader comes after)
update_parameters = not _mpl_ax_contains_elements(ax)
_cax = ax.scatter(
cax = ax.scatter(
adata[:, 0].X.flatten(),
adata[:, 1].X.flatten(),
s=render_params.size,
Expand All @@ -1029,7 +1029,6 @@ def _render_points(
zorder=render_params.zorder,
plotnonfinite=True, # nan points should be rendered as well
)
cax = ax.add_collection(_cax)
if update_parameters:
# necessary if points are plotted with mpl first and then with datashader
extent = get_extent(sdata_filt.points[element], coordinate_system=coordinate_system)
Expand Down Expand Up @@ -1721,7 +1720,7 @@ def _draw_labels(
outline_color=outline_color,
)

_cax = ax.imshow(
cax = ax.imshow(
labels,
rasterized=True,
cmap=None if categorical else render_params.cmap_params.cmap,
Expand All @@ -1730,9 +1729,8 @@ def _draw_labels(
origin="lower",
zorder=render_params.zorder,
)
_cax.set_transform(trans_data)
cax = ax.add_image(_cax)
return cax # noqa: RET504
cax.set_transform(trans_data)
return cax

# When color is a literal (col_for_color is None) and no explicit outline_color,
# use the literal color for outlines so they are visible (e.g., color='white' on
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_images/Labels_can_color_with_norm_and_clipping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_images/Labels_can_color_with_norm_no_clipping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_images/Labels_respects_custom_colors_from_uns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading