Description Usage Arguments Value Examples
This is a default for visualizing 2d density plots.
1 | ggcontours(plot_data, opts = list())
|
plot_data |
[data.frame] A data.frame with data to create the density plot from. The variables for x, y axis, fill, and faceting must be provided by opts. Otherwise, they will be filled in with defaults, see merge_contour_opts(). The order in which variables appear on the axes is controlled by opts$x_order and opts$y_order. |
opts |
[list] A partially specified list used to customize appearance in ggplot theme(). Options that are already specified will not be changed, those that are not will be filled in with defaults. |
p [ggplot] A ggplot stat_density2d object with nice defaults.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | plot_data <- expand.grid(
"ix" = seq_len(1000),
"row" = c("A", "B", "C"),
"col" = c("alpha", "beta", "gamma")
)
plot_data <- cbind(
plot_data,
x = rnorm(9000),
y = rnorm(9000)
)
ggcontours(plot_data, list(facet_terms = c("row", "col")))
ggcontours(plot_data, list(facet_terms = c("row", ".")))
ggcontours(plot_data, list(facet_terms = c("row", "."), fill_type = "discrete", fill = "col"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.