| geom_relief {metR} | R Documentation |
Relief Shading
Description
geom_relief() simulates shading caused by relief. Can be useful when
plotting topographic data because relief shading might give a more intuitive
impression of the shape of the terrain than contour lines or mapping height
to colour. geom_shadow() projects shadows.
Usage
geom_relief(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
sun.angle = 60,
raster = TRUE,
interpolate = TRUE,
shadow = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_shadow(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
sun.angle = 60,
range = c(0, 1),
skip = 0,
raster = TRUE,
interpolate = TRUE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
Arguments
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, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
Other arguments passed on to |
sun.angle |
angle from which the sun is shining, in degrees counterclockwise from 12 o' clock |
raster |
if |
interpolate |
If |
shadow |
if TRUE, adds also a layer of |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
range |
transparency range for shadows |
skip |
data points to skip when casting shadows |
Details
light and dark must be valid colours determining the light and dark shading
(defaults to "white" and "gray20", respectively).
Aesthetics
geom_relief() and geom_shadow() understands the following aesthetics (required aesthetics are in bold)
-
x
-
y
-
z
-
light -
dark -
sun.angle
See Also
Other ggplot2 helpers:
MakeBreaks(),
WrapCircular(),
geom_arrow(),
geom_contour2(),
geom_contour_fill(),
geom_label_contour(),
geom_streamline(),
guide_colourstrip(),
map_labels,
reverselog_trans(),
scale_divergent,
scale_longitude,
stat_na(),
stat_subset()
Examples
## Not run:
library(ggplot2)
ggplot(reshape2::melt(volcano), aes(Var1, Var2)) +
geom_relief(aes(z = value))
## End(Not run)