Skip to contents

Building a plot

Start a plot from a data frame, an sf object, or an igraph graph, then render it or write it to a file.

vplot()
Start a plot specification
vgraph()
Start a graph (network) plot
render_plot()
Render a plot to a file
PlotSpec()
The plot specification

Marks

Layers that draw data. Scales train across every mark on the panel.

Points, lines, and bars

mark_point() mark_line() mark_rule() mark_bar()
Add marks to a plot
mark_area() mark_ribbon() mark_step()
Area, ribbon, and step marks
mark_segment()
Segment mark

Distributions and intervals

Text, pie, and large data

mark_text() mark_label()
Text marks
mark_pie() mark_donut()
Pie and donut charts
mark_datashade()
Datashade a large point cloud

Spatial and network

mark_sf()
Draw simple-feature (sf) geometries
mark_edges() mark_nodes() mark_node_text()
Network (graph) marks
scale_edge_width()
Edge-width scale

Scales

Map data values to visual properties, with trained domains and guides.

Coordinates and facets

coord_cartesian() coord_flip() coord_fixed() coord_equal()
Coordinate systems
coord_trans()
Transformed coordinate system
coord_polar()
Polar coordinates
coord_sf()
Map coordinate system
facet_wrap() facet_grid()
Facet a plot into a grid of panels
add_marginal()
Add marginal distributions to a plot

Composition

Combine plots into a single figure, or repeat one over a variable.

concat() wrap_plots() hconcat() vconcat()
Arrange plots side by side
inset()
Overlay a plot as an inset
plot_spacer()
Reserve an empty cell in a composition
area()
Define a layout area for design =
repeat_()
Repeat a view across fields
compose_annotation()
Annotate a composition

Themes and annotation

theme_gray() theme_minimal() theme_bw() theme_classic() theme_void() theme_cyberpunk() theme() set_theme()
Plot themes
theme_sketch()
Hand-drawn plot theme
element_text() element_line() element_rect() element_blank()
Theme elements
labs()
Set plot titles and axis/legend labels
annotate()
Add a one-off annotation
md()
Rich-text labels

Layer effects

Glow, shadow, outline, hand-drawn sketching, and gradient fills.

glow()
Neon glow layer effect
shadow()
Shadow layer effect
outline()
Outline (halo) layer effect
sketch()
Hand-drawn ("sketch") rendering
linear_gradient() radial_gradient()
Gradient fill paints

Accessibility and provenance

Attach a text alternative for screen readers, or inspect how a spec compiled into a scene.

plot_alt()
Text alternative (alt text) for a plot
plot_provenance()
Inspect the compiled-scene provenance of a plot

Package

vellumplot vellumplot-package
vellumplot: A Grammar of Graphics on the 'vellum' Backend