Skip to content

Commit 2eb74db

Browse files
committed
Add comment to motivate scale_y_reverse() approach
1 parent 84f2d4e commit 2eb74db

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

R/plotImage.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,7 @@ setMethod("plotImage", "SpatialData", \(x, i=1, j=1, k=NULL, ch=NULL, c=NULL, cl
222222
#' @rdname plotImage
223223
#' @importFrom ggplot2 ggplot scale_y_reverse coord_fixed
224224
plotSpatialData <- \() ggplot() + scale_y_reverse() + coord_fixed() + .theme
225+
# `annotation_raster` plots the array the same way it is printed, i.e., with the
226+
# row 1 at the top, which means we need to flip the y-axis to have the correct axis labels.
227+
# We tried flipping the image itself but it means everything gets out of alignement if
228+
# the user sets `scale_y_reverse()` themselves.

0 commit comments

Comments
 (0)