keybox: keybox

View source: R/keybox.R

keyboxR Documentation

keybox

Description

draw border for each of the ggplot legends

Usage

keybox(p, grob = "roundrect", gp = NULL)

Arguments

p

a ggplot object

grob

one of 'rect' or 'roundrect'

gp

graphic parameter

Value

grob object

Author(s)

Guangchuang Yu

Examples

library(ggplot2)
p <- ggplot(mtcars, aes(mpg, disp, color=factor(cyl), size=cyl)) + geom_point()
keybox(p, 'roundrect', gp = gpar(col = '#808080', lty = "dashed"))

YuLab-SMU/ggfun documentation built on April 14, 2025, 1:54 p.m.