Skip to contents

vplot() begins a declarative, pipe-first plot. It captures the data and page size and returns an inspectable PlotSpec; nothing is drawn until the spec is compiled (via render_plot() or vellum::as_vellum_scene()). Build the plot up with mark_point() / mark_line() / mark_rule() and the scale_*() functions.

Usage

vplot(data, width = 6, height = 4, dpi = 96)

Arguments

data

A data frame. Encoding expressions in mark_*() are evaluated against it with tidy evaluation.

width, height

Page size in inches.

dpi

Output resolution in dots per inch. The exported PNG's pixel dimensions are width * dpi by height * dpi; raising dpi yields a denser image at the same physical size. Overridable at render time via render_plot()'s dpi argument.

Value

A PlotSpec.

Examples

vplot(mtcars) |> mark_point(x = wt, y = mpg)