Skip to contents

Creating plots

plot2() creates a complete plot from data in one call. Its methods accept data frames, vectors, tables, formulas, matrices, models and geographic data. add_type() and its shortcuts add layers to a plot.

Changing plots

Change the mapping or the order of the layers of an existing plot, or use the coordinate system of spider plots.

add_mapping()
Add Additional Mapping
move_layer()
Move a ggplot Layer
coord_spider() CoordSpider
Spider (Radar) Coordinate System for ggplot2

Colours

Get colours from names and palettes, and register the colours of an organisation for use in all plots.

get_colour() register_colour() unregister_colour() add_white()
Get (and Register) Colours from R, Viridis and More

Themes, titles and labels

The default theme of plot2(), markdown in titles, and labelling functions for axes and data labels.

theme_minimal2()
An Even More Minimal Theme
md_to_expression()
Convert Markdown to Plotmath Expression
get_plot_title()
Get Plot Title
euros() dollars()
Label Currencies

Number formatting

The decimal mark and thousands separator, determined from the session or set with options.

dec_mark() big_mark()
Use Decimal Comma?

Interactive use

Convert a plot to an interactive plotly widget, or build a plot in a Shiny app.

as_plotly() plotly_style()
Create Interactive Plotly
create_interactively()
Interactively Create a plot2

Options

Package options that set defaults for all plots in a session.

Data sets

Example data sets used in the documentation.

admitted_patients
Example Data Set with Admitted Patients
netherlands
Example Geography Data Set: the Netherlands

dplyr and tidyselect functions

These are functions from dplyr and tidyselect that can be used in plot2() directly, without the need to load those packages first.