mark_area() fills the region between a y line and the zero baseline;
mark_ribbon() fills between ymin and ymax; mark_step() draws a
staircase line. All connect points in x order.
Usage
mark_area(
plot,
...,
position = "stack",
blend = NULL,
sketch = NULL,
data = NULL
)
mark_ribbon(plot, ..., blend = NULL, sketch = NULL, data = NULL)
mark_step(
plot,
...,
direction = "hv",
auto = FALSE,
blend = NULL,
effects = list(),
sketch = NULL,
data = NULL
)Arguments
- plot
- ...
Encodings (tidy-eval):
xandyfor area/step;x,ymin,ymaxfor ribbon; pluscolor/fill/alpha.- position
For
mark_area(), how areas sharing anxcombine whenfill/coloris mapped:"stack"(default) stacks them into a band,"fill"normalises eachxto 1,"identity"overlays them from the zero baseline. With no fill mapping all three are equivalent (a single area).- blend
Optional blend mode for compositing this layer against what is already drawn beneath it (the panel and earlier layers), one of the CSS
mix-blend-modenames, e.g."multiply","screen","darken". The whole layer composites as one isolated group (not per element).- sketch
A
sketch()spec giving this layer a hand-drawn look (wobbly outlines, hachure fills),NA/FALSEto force it crisp (overriding a plot-widetheme_sketch()), orNULL(default) to inherit. Geometry marks accept it; text, raster, hex and datashade marks do not.- data
Optional layer data frame; overrides the plot data for this layer.
- direction
For
mark_step(),"hv"(horizontal then vertical, default) or"vh".- auto
For
mark_point(),mark_line(),mark_step(),mark_segment(), andmark_edges(), whenTRUEand the layer has very many rows, automatically render it as a datashaded density raster (seemark_datashade()) instead of individual vector marks: points bin into a density grid (vellum::datashade()), dense lines/steps rasterise as connected polylines (vellum::datashade_lines()), and segments/edges as independent segments (vellum::datashade_segments()). The datashaded line/segment output isdynspread-ed so thin marks stay visible (see thespreadargument ofmark_datashade()). The fallback is skipped under a warped coordinate system (coord_polar()/coord_trans()), which draws the vector marks instead.- effects
A list of layer render effects applied to the mark at draw time —
glow(),outline(), andshadow(). Available on stroked and point marks.
Value
The modified PlotSpec.
Examples
vplot(pressure) |> mark_area(x = temperature, y = pressure)
