p <- ggplot(mtcars, aesthetics=list(x=wt, y=mpg)) pdf("bar-line-point.pdf", height=6, width=6*4/3, version="1.4") extra <- data.frame(wt=1:4 + 1, mpg=5:8 * 2) ggline(ggpoint(ggbar(p, data=extra)), data=extra, size=5, colour=alpha("red", 0.5), aes=list(y=sqrt(mpg)+rnorm(4,20,3))) dev.off() pdf("text.pdf", height=6, width=6*4/3, version="1.4") ggtext(ggplot(mtcars, aesthetics=list(x=wt, y=mpg, labels = rownames(mtcars)))) dev.off() pdf("smooth.pdf", height=6, width=6*4/3, version="1.4") ggsmooth(ggpoint(p)) dev.off() pdf("histogram-density.pdf", height=6, width=6*4/3, version="1.4") ggdensity(gghistogram(p, breaks=15), adjust=0.5, size=5, colour=alpha("darkgreen", 0.8)) dev.off() pp <- function (n,r=4) { x <- seq(-r*pi, r*pi, len=n) df <- expand.grid(x=x, y=x) df$r <- sqrt(df$x^2 + df$y^2) df$z <- cos(df$r^2)*exp(-df$r/6) df } pdf("tile.pdf", height=6, width=6*4/3, version="1.4") scfillgradient(ggtile(ggplot(pp(100), aes=list(x=x,y=y,fill=z)))) dev.off() pdf("aesthetics.pdf", height=6, width=6*4/3, version="1.4") p2 <- ggpoint(p, aesthetics=list(colour=cyl, size=wt, shape=cyl)) pscontinuous(p2, "x", trans=trans_inverse) dev.off()