Description Usage Arguments Examples
View source: R/geom-isobands.R
Draw isoband and isoline contours.
1 2 3 4 5 6 7 8 9 | geom_isobands(mapping = NULL, data = NULL, stat = "isolevels",
position = "identity", ..., bins = NULL, binwidth = NULL,
breaks = NULL, polygon_outline = TRUE, na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE)
geom_density_bands(mapping = NULL, data = NULL, stat = "densitygrid",
position = "identity", ..., bins = NULL, binwidth = NULL,
breaks = NULL, polygon_outline = TRUE, na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE)
|
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed on to |
bins |
Number of bins for discretization. Has priority
over |
binwidth |
Binwidth used during discretization. |
breaks |
Explicit bin boundaries to use for discretization.
Has priority over both |
polygon_outline |
Draw filled polygons with equally colored outlines? The
default is |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
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 34 35 | library(ggplot2)
volcano3d <- reshape2::melt(volcano)
names(volcano3d) <- c("x", "y", "z")
ggplot(volcano3d, aes(x, y, z = z)) +
geom_isobands(aes(color = stat(zmin)), fill = NA) +
scale_color_viridis_c() +
coord_cartesian(expand = FALSE) +
theme_bw()
ggplot(volcano3d, aes(x, y, z = z)) +
geom_isobands(aes(fill = stat(zmin)), color = NA) +
scale_fill_viridis_c(guide = "legend") +
coord_cartesian(expand = FALSE) +
theme_bw()
# set polygon_outline = FALSE when drawing filled polygons
# with alpha transparency
ggplot(volcano3d, aes(x, y, z = z)) +
geom_isobands(
aes(fill = stat(zmin)), color = NA,
alpha = 0.5, polygon_outline = FALSE
) +
scale_fill_viridis_c(guide = "legend") +
coord_cartesian(expand = FALSE) +
theme_bw()
ggplot(faithful, aes(eruptions, waiting)) +
geom_density_bands(
aes(fill = stat(density)),
color = "gray40", alpha = 0.7, size = 0.2
) +
geom_point(shape = 21, fill = "white") +
scale_fill_viridis_c(guide = "legend")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.