Description Usage Arguments Value Examples
gg.plotHolder
1 | gg.plotHolder(useArial = F, afmPATH = "~/Dropbox")
|
useArial |
Use the Arial font (requires |
afmPATH |
Path to Arial |
A blank ggplot2
object that can be used in concordance with grid.arrange
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # Create a plot with marginal distributions.
library(ggplot2)
library(scales)
df <- data.frame(x = rnorm(n = 100), y = rnorm(n = 100),
group = factor(sample(x=c(0,1),
size = 100, replace = TRUE))
)
scatterP <- ggplot(df, aes(x = x, y =y, colour = group)) +
geom_point() +
gg.theme()
xDense <- ggplot(df, aes(x = x, fill = group)) +
geom_density(aes(y= ..count..),trim=FALSE, alpha=.5) +
gg.theme("noax") +
theme(legend.position = "none")
yDense <- ggplot(df, aes(x = y, fill = group)) +
geom_density(aes(y= ..count..),trim=FALSE, alpha=.5) +
coord_flip() +
gg.theme("noax") +
theme(legend.position = "none")
library(gridExtra)
grid.arrange(xDense,
gg.plotHolder(),
scatterP,
yDense,
ncol=2, nrow=2,
widths=c(4, 1.4), heights=c(1.4, 4)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.