geom_relief | R Documentation |
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.
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
)
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.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
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 |
light
and dark
must be valid colours determining the light and dark shading
(defaults to "white" and "gray20", respectively).
geom_relief()
and geom_shadow()
understands the following aesthetics (required aesthetics are in bold)
x
y
z
light
dark
sun.angle
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()
## Not run:
library(ggplot2)
ggplot(reshape2::melt(volcano), aes(Var1, Var2)) +
geom_relief(aes(z = value))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.