A convenience wrapper around panel_background() with defaults suited to
subtle overlays: a neutral grey fill at 25% opacity with no border. Should
be placed before geom layers.
Usage
panel_shade(
xmin = -Inf,
xmax = Inf,
ymin = -Inf,
ymax = Inf,
fill = "#878580",
alpha = 0.25,
colour = "transparent",
linewidth = NULL,
linetype = 1,
layout = NULL
)Arguments
- xmin, xmax
Left and right edges of the rectangle in data coordinates. Defaults to
-InfandInf. UseI()for normalised coordinates (0-1). May be a vector for multiple rectangles. Bounds may be mixed freely, e.g.xmin = I(0.5), xmax = Inffills from 50% to the right panel edge.- ymin, ymax
Bottom and top edges of the rectangle in data coordinates. Defaults to
-InfandInf. UseI()for normalised coordinates (0-1). May be a vector for multiple rectangles.- fill
Fill colour. Defaults to a neutral grey. May be a vector the same length as the bounds.
- alpha
Opacity. Defaults to
0.25. May be a vector.- colour
Border colour. Defaults to
"transparent". May be a vector.- linewidth
Inherits from
panel.borderin the set theme. Supportsrel(). May be a vector.- linetype
Border linetype. Defaults to
1. May be a vector.- layout
Controls which panels the annotation appears in.
NULL(default) repeats in all panels. An integer targets a specific panel."fixed"repeats in all panels ignoring faceting variables. Seeggplot2::layer()for full details.