PlotSpec is the S7 class that vplot() creates and the mark_*() /
scale_*() functions extend. It is a plain, inspectable, serializable data
object: data, a list of layers, a list of scale overrides, and the page size.
Nothing is drawn until it is compiled with vellum::as_vellum_scene() (e.g.
via render_plot()). Printing it draws the plot; inspect its structure with
base::summary().
Usage
PlotSpec(
data = NULL,
edge_data = NULL,
layers = list(),
scales = list(),
facet = NULL,
coord = NULL,
resolve = list(),
width = 6,
height = 4,
dpi = 96,
theme = NULL,
labels = list(),
marginal = NULL,
selections = list(),
filters = list(),
binds = list(),
clip = NULL,
transition = NULL,
ease = NULL,
source = NULL
)Arguments
- data
The data frame.
- edge_data
For a graph plot (from
vgraph()), the edge table; the default data formark_edges().NULLfor ordinary plots.- layers
A list of layer specifications (one per
mark_*()).- scales
A list of declared scale overrides.
- facet
A faceting specification (from
facet_wrap()/facet_grid()), orNULLfor a single panel.- coord
A coordinate specification (from
coord_cartesian()/coord_flip()/coord_fixed()), orNULLfor the default Cartesian system.- resolve
A named list mapping an aesthetic to
"shared"or"independent"(the scale-resolution lattice; seeresolve_scale()).- width, height
Page size in inches.
- dpi
Output resolution in dots per inch (pixels per inch). The exported PNG's pixel dimensions are
width * dpibyheight * dpi.- theme
A theme (a named list of resolved element/setting overrides, from
theme()/ atheme_*()preset), orNULLfor the default theme.- labels
A named list of plot/axis/legend label overrides (see
labs()).- marginal
A marginal-distribution specification (from
add_marginal()), orNULLfor no marginals.- selections
A list of interactive selection declarations (from
select_point()/select_interval()/add_selection()).- filters
A list of filter declarations (from
filter_by()).- binds
A list of scale-domain bind declarations (from
bind_scale()).- clip
A
clip_to()/set_mask()geometry clip (aClipSpec), orNULLfor none.- transition
A keyframe-animation transition (from
transition_states()/transition_time()/transition_reveal()), orNULL. Read only byanimate(); inert on a static render.- ease
An animation easing (from
ease_aes()), orNULL.- source
A source-inspection declaration (from
inspect_source()), orNULL. Inert on a static render; a host surfaces the data rows behind a clicked element.
