ggPlot2: Basics
Basic Plot |
ggplot(dataset, aes(x, y, colour=z) |
ggPlot2: layers
mapping |
Some asthetic mappings (aes) |
data |
The dataset to use |
geom |
Override default geom |
stat |
Override default stat |
position |
Adjustment for overlapping objects (dodge, fill, identity, jitter, stack) |
... |
Parameters for geom or stat; also aesthetics with constant values |
Layers may be added to plot objects using the layer command or stat_... and geom_... functions. Parameters not set are taken from the function's or plot's default values.
ggPlot2: Stats
bin |
boxplot |
contour |
density |
density2d |
function |
idendity |
qq |
quantile |
smooth |
spoke |
step |
sum |
summary |
unique |
|
|
ggPlot2: Geoms
abline |
intercept, linetype, size, slope |
area |
fill, linetype, size, x, y |
bar |
fill, linetype, size, weight, x, y |
bin2d |
fill, linetype, size, weight, xmin, xmax, ymin, ymax |
boxplot |
fill, lower, middle, size, upper, weight, x, ymax, ymin |
contour |
linetype, size, weight, x, y |
crossbar |
fill, linetype, size, x, y, ymax, ymin |
density |
fill, linetype, size, weight, x, y |
density2d |
linetype, size, weight, x, y |
errorbar |
fill, linetype, size, x, y, ymax, *ymin |
freqpoly |
linetype, size |
hex |
fill, size, x, y |
histogram |
fill, linetype, size, weight, x |
hline |
linetype, size |
jitter |
fill, shape, size, x, y |
line |
linetype, size, x, y |
linerange |
linetype, size, x, ymax, ymin |
path |
linetype, size, x, y |
point |
fill, shape, size, x, y |
pointrange |
fill, linetype, shape, size, x, y, ymax, ymin |
polygon |
fill, linetype, size, x, y |
quantile |
linetype, size, weight, x, y |
rect |
fill, linetype, size, xmax, xmin, ymax, ymin |
ribbon |
fill, linetype, size, x, ymax, ymin |
rug |
linetype, size |
segment |
colour, linetype, size, x, xend, y, yend |
smooth |
fill, linetype, size, weight, x, y |
step |
linetype, size, x, y |
text |
angle, hjust, label, size, vjust, x, y |
tile |
fill, linetype, size, x, y |
vline |
linetype, size |
Additionally, all geoms have colour and alpha aesthetics. Bold values are required (or provided by used statistics).
|
|
|