diff --git a/R/plotFrame.R b/R/plotFrame.R index 8bc4948..9e5ea86 100644 --- a/R/plotFrame.R +++ b/R/plotFrame.R @@ -82,7 +82,7 @@ NULL list( do.call(geom_sf, c(list(data=df, mapping=aes), c(dot))), theme(legend.key.size=unit(0.5, "lines")), - coord_sf(expand=FALSE, reverse="y")) + coord_sf(expand=FALSE)) } #' @export #' @rdname plotFrame diff --git a/R/plotImage.R b/R/plotImage.R index af48765..5e56a86 100644 --- a/R/plotImage.R +++ b/R/plotImage.R @@ -163,6 +163,12 @@ NULL a <- .get_multiscale_data(x, k) a <- a[.ch_idx(x, ch),,,drop=FALSE] a <- .norm_ia(a, data_type(x)) + # We later use `annotation_raster()`, which plots the array the same way it is printed, + # i.e., with the row 1 at the top, which doesn't match the rest of the ecosystem, + # so we mirror the image horizontally. + # FIXME: at some point, we would like to use `SpatialData::mirror()` directly in the + # `plotImage()` for this but it's currently not lazy and super slow. + a <- a[, rev(seq_len(dim(a)[2])), , drop=FALSE] a <- .prep_ia(a, c, cl) }