From ddf35bf22a31481a020abacf530b7f62bab3e225 Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Tue, 28 May 2024 10:57:34 -0400 Subject: [PATCH] chore: update docs for `spatPlot2D()` --- R/vis_spatial.R | 19 ++++++++++++++----- man/spatPlot.Rd | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/R/vis_spatial.R b/R/vis_spatial.R index 16177af..a38e993 100644 --- a/R/vis_spatial.R +++ b/R/vis_spatial.R @@ -481,9 +481,6 @@ #' @param theme_param list of additional params passed to `ggplot2::theme()` #' @details coord_fix_ratio: set to NULL to use default ggplot parameters #' @returns ggplot -#' @examples -#' g <- GiottoData::loadGiottoMini("visium") -#' spatPlot2D(g) #' @export spatPlot2D <- function( gobject, @@ -760,8 +757,20 @@ spatPlot2D <- function( #' @family spatial visualizations #' @returns ggplot #' @examples -#' g <- GiottoData::loadGiottoMini("visium") -#' spatPlot(g) +#' g <- GiottoData::loadGiottoMini("visium", verbose = FALSE) +#' spatPlot(g, show_image = TRUE, image_name = "image") +#' +#' # the more specific spatPlot2D with networks shown +#' spatPlot2D(g, show_image = TRUE, image_name = "image", show_network = TRUE) +#' +#' # plotting of some cell metadata (number of different features detected) +#' spatPlot2D(g, +#' show_image = TRUE, +#' image_name = "image", +#' cell_color = "nr_feats", +#' color_as_factor = FALSE, +#' gradient_style = "sequential" +#' ) #' @export #' @seealso \code{\link{spatPlot3D}} spatPlot <- function(...) { diff --git a/man/spatPlot.Rd b/man/spatPlot.Rd index 139ccbc..fc8b451 100644 --- a/man/spatPlot.Rd +++ b/man/spatPlot.Rd @@ -292,10 +292,20 @@ Visualize cells according to spatial coordinates coord_fix_ratio: set to NULL to use default ggplot parameters } \examples{ -g <- GiottoData::loadGiottoMini("visium") -spatPlot2D(g) -g <- GiottoData::loadGiottoMini("visium") -spatPlot(g) +g <- GiottoData::loadGiottoMini("visium", verbose = FALSE) +spatPlot(g, show_image = TRUE, image_name = "image") + +# the more specific spatPlot2D with networks shown +spatPlot2D(g, show_image = TRUE, image_name = "image", show_network = TRUE) + +# plotting of some cell metadata (number of different features detected) +spatPlot2D(g, + show_image = TRUE, + image_name = "image", + cell_color = "nr_feats", + color_as_factor = FALSE, + gradient_style = "sequential" +) } \seealso{ \code{\link{spatPlot3D}}