Skip to content

Commit f595c0d

Browse files
author
Sonja Stockhaus
committed
transformation fix
1 parent 8fce7dd commit f595c0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/spatialdata_plot/pl/render.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _render_shapes(
149149
# Apply the transformation to the PatchCollection's paths
150150
trans = get_transformation(sdata_filt.shapes[element], get_all=True)[coordinate_system]
151151
affine_trans = trans.to_affine_matrix(input_axes=("x", "y"), output_axes=("x", "y"))
152-
trans = mtransforms.Affine2D(matrix=affine_trans) + ax.transData
152+
trans = mtransforms.Affine2D(matrix=affine_trans)
153153

154154
shapes = gpd.GeoDataFrame(shapes, geometry="geometry")
155155

@@ -162,6 +162,8 @@ def _render_shapes(
162162
logger.info(f"Using {method}")
163163

164164
if method == "datashader":
165+
trans = mtransforms.Affine2D(matrix=affine_trans) + ax.transData
166+
165167
extent = get_extent(sdata.shapes[element])
166168
x_ext = extent["x"][1]
167169
y_ext = extent["y"][1]

0 commit comments

Comments
 (0)