toplegend: Make a legend on top or right side of plot

View source: R/toplegend.r

toplegendR Documentation

Make a legend on top or right side of plot

Description

Make a legend on top or right side of plot

Usage

toplegend(horiz = TRUE, ...)

rightlegend(...)

Arguments

horiz

Horizontal layout?

...

Further arguments to legend()

Examples

g <- rbinom(20, 1, 0.5)
x <- rnorm(20)
y <- rnorm(20)
plot(x, y, col=pal(2)[g+1], pch=19)
toplegend(legend=c('Group 1', 'Group 2'), col=pal(2), pch=19)

pbreheny/breheny documentation built on April 26, 2024, 10:40 a.m.