fluorLegend: Add legend of fluorescence targets that make up image

View source: R/plottingBasics.R

fluorLegendR Documentation

Add legend of fluorescence targets that make up image

Description

Creates legend that can be overlayed on image using cowplot.

Usage

fluorLegend(overlay, nrow = 4, textSize = 10, boxColor = "grey", alpha = 0.25)

Arguments

overlay

SpatialOverlay

nrow

number of rows in the legend. Most studies have 4 which is where the values came from: 1 = horizontal legend, 4 = vertical legend, 2 = box legend

textSize

font size

boxColor

color of box behind legend

alpha

alpha value of box behind legend

Value

gp of fluorescence legend

Examples


muBrain <- readRDS(unzip(system.file("extdata", "muBrainSubset_SpatialOverlay.zip",
                                    package = "SpatialOmicsOverlay")))

# image <- downloadMouseBrainImage()

# muBrain <- addImageOmeTiff(overlay = muBrain, 
#                           ometiff = image, res = 8)
                             
gp <- plotSpatialOverlay(overlay = muBrain,   
                         hiRes = FALSE, scaleBar = FALSE)
                         
legend <- fluorLegend(muBrain, nrow = 2, textSize = 3, boxColor = "red")

cowplot::ggdraw() + 
    cowplot::draw_plot(gp) +
    cowplot::draw_plot(legend, scale = 0.12, x = -0.3, y = -0.25)


Nanostring-Biostats/SpatialOmicsOverlay documentation built on April 20, 2024, 5:36 a.m.