layer_order | R Documentation |
This function allows you to change the order in which layers are added to a ggplot.
layer_order(layer, order = 0)
layer |
A |
order |
An integer indicating the position at which the layer should be
added. If |
A layer_order
object.
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
geom_point(color = "red", size = 1)
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
layer_order(geom_point(color = "red", size = 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.