Skip to contents

Core

Build and inspect the visualization spec.

glyph()
Create a Glyph Visualization
print(<glyph_spec>) knit_print(<glyph_spec>)
Draw a glyph spec when it is printed
summary(<glyph_spec>)
Summarize a glyph specification

Marks

Geometric layers that draw data onto the plot.

marks
Visual Marks
mark_point()
Add a point mark (scatterplot)
mark_line()
Add a line mark
mark_bar()
Add a bar mark
mark_area()
Add an area mark
mark_text()
Add a text/label mark
mark_rule()
Add a rule (reference line) mark
mark_ribbon()
Add a ribbon/band mark (for confidence intervals, ranges)
mark_link()
Add a link/edge mark (for networks, sankeys, slope graphs)
mark_polygon()
Add a polygon mark

Statistical marks

Marks that summarise the distribution of a variable.

mark_boxplot()
Add a boxplot mark
mark_violin()
Add a violin mark
mark_sina()
Add a sina mark
mark_histogram()
Add a histogram mark

Interactivity

Tooltips, zoom, brushing, and linked selections.

interactivity
Interactivity
interact()
Add interactive behaviors to a glyph spec
selection()
Add a selection parameter (advanced)

Animation

Transitions and entrance/exit animation.

animation
Animation Grammar
animate()
Add animation/transition behavior

Scales

Control how data maps to visual properties.

set_scale()
Define a scale for an aesthetic channel
scale_color() scale_log() scale_time()
Scales

Theming

Token-based theme system and plot titles.

theming
Token-Based Theming
theme_tokens()
Set theme tokens
titles()
Add a title, subtitle, or caption

Layout

Multi-plot composition and auxiliary panels.

layout
Layout Composition
compose()
Compose multiple glyph specs into a layout
print(<glyph_layout>) knit_print(<glyph_layout>)
Draw a glyph layout when it is printed
summary(<glyph_layout>)
Summarize a glyph layout
marginals()
Add a marginal plot (histogram/density on axes)
inset()
Add an inset plot
facet()
Facet a plot by one or two variables

Rendering

Compile the spec and render or export it.

rendering
Rendering Pipeline
compile()
Compile a glyph spec to a resolved representation
render()
Render a glyph spec as an htmlwidget
export()
Export to various formats
to_vegalite()
Export the spec as Vega-Lite JSON (interop)

Shiny

Use plots in Shiny apps and read what the user selects.

glyphOutput() renderGlyph()
Use glyph plots in Shiny