From e8452cca85b1d6defa73cdc5053b0a1301bb5129 Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:40:01 -0500 Subject: [PATCH] enh: pass xlim ylim setting to image --- R/vis_spatial_in_situ.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/vis_spatial_in_situ.R b/R/vis_spatial_in_situ.R index e249293..ae429e4 100644 --- a/R/vis_spatial_in_situ.R +++ b/R/vis_spatial_in_situ.R @@ -189,6 +189,11 @@ spatInSituPlotPoints <- function( ## 0. plot image ## if (isTRUE(show_image) && !is.null(gimage)) { + + if (!is.null(xlim) && !is.null(ylim)) { + e <- ext(c(xlim, ylim)) + } + plot <- plot_spat_image_layer_ggplot( gg_obj = plot, gobject = gobject, @@ -196,7 +201,8 @@ spatInSituPlotPoints <- function( feat_type = feat_type, spat_loc_name = spat_loc_name, polygon_feat_type = polygon_feat_type, - gimage = gimage + gimage = gimage, + ext = e ) if (isTRUE(verbose)) wrap_msg("plot image layer done")