Learn R Programming

scCustomize (version 3.0.0)

Move_Legend: Move Legend Position

Description

Shortcut for thematic modification to move legend position.

Usage

Move_Legend(position = "right", ...)

Value

Returns a list-like object of class theme.

Arguments

position

valid position to move legend. Default is "right".

...

extra arguments passed to ggplot2::theme().

Examples

Run this code
# Generate a plot and customize theme
library(ggplot2)
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'))
p + Move_Legend("left")

Run the code above in your browser using DataLab