Learn R Programming

Seurat (version 2.3.4)

HoverLocator: Hover Locator

Description

Get quick information from a scatterplot by hovering over points

Usage

HoverLocator(plot, data.plot, features.info = NULL, dark.theme = FALSE, ...)

Arguments

plot

A ggplot2 plot

data.plot

The oridinal data that went into the ggplot2 plot

features.info

An optional dataframe or matrix of extra information to be displayed on hover

dark.theme

Plot using a dark theme?

...

Extra parameters to be passed to plotly::layout

See Also

plotly::layout

ggplot2::ggplot_build

Examples

Run this code
# NOT RUN {
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
HoverLocator(plot = p, data.plot = df)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab