ggcontours: Default Contour / Stat Density 2D plot

Description Usage Arguments Value Examples

Description

This is a default for visualizing 2d density plots.

Usage

1
ggcontours(plot_data, opts = list())

Arguments

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.

Value

p [ggplot] A ggplot stat_density2d object with nice defaults.

Examples

 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"))

krisrs1128/ggscaffold documentation built on May 20, 2019, 1:26 p.m.