ggplot2
and
various geoms. For plots with just one layer, the formula interface
is more compact and is consistent with modeling and mosaic notation.
The functions generate a ggplot
command string which can be displayed by
setting verbose = TRUE
as an argument.
gf_point(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_jitter(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_line(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_path(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_density(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_density_2d(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_hex(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_hline(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_abline(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_hex(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_boxplot(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_freqpoly(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_histogram(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_text(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_counts(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_bar(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
gf_frame(placeholder = NULL, formula = NULL, data = NULL, geom = type, verbose = FALSE, add = FALSE, ...)
y ~ x + color:red + shape:sex + alpha:0.5
TRUE
print the ggplot2 command in the console.TRUE
then construct just the layer with no frame. The result
can be added to an existing frame.position="dodge"
,gf_
functions are written to interact with ggplot objects. The placeholder
argument is part of this interaction system; the end user can ignore it.
gf_point(mpg ~ hp + color:cyl + size:wt, data = mtcars)
gf_line(mpg ~ hp + group:cyl, data = mtcars) + facet_grid(~ am)
gf_histogram(~ Sepal.Length + fill:Species, data = iris)
gf_text(Sepal.Length ~ Sepal.Width + label:Species + color:Species , data = iris)
Run the code above in your browser using DataLab