hadley/ggplot2 — Issue #404: legend clipping
Author: baptiste
Created: 2012-02-14 02:58:00+00:00
State: open

version 0.9.0 clips the legend to the plot panel width and height, as illustrated below:

```r
library(ggplot2)

d <- data.frame(x=rnorm(100), y=rnorm(100), f=letters[1:25])

p <- ggplot(d, aes(x, y, colour=f)) +
geom_path() + opts(title="very long title very long title very long title very long title very long title")

pdf("clipping.pdf", width=5, height=5)
p + opts(legend.position="right", legend.direction="vertical")
p + opts(legend.position="left", legend.direction="vertical")
p + opts(legend.position="top", legend.direction="horizontal")
p + opts(legend.position="bottom", legend.direction="horizontal")
dev.off()
```