The following plot types are supported.
Any ggplot2 geom is supported, but we added support for
some other, more advanced plots.
Used for comparing discrete categories through rectangular bars.
In plot2, bar types are horizontal alternatives for
column types (just like MS Excel):
Used for visualising trends over ordered intervals.
Used for displaying individual observations in a two dimensional space.
Used for emphasising cumulative magnitudes across continuous domains.
airquality |>
plot2(x = Day,
y = Wind,
category = Month,
category.character = TRUE,
stacked_fill= TRUE,
type = "area")Used for summarising and comparing distributions with focus on spread and density.
Used for visualising the frequency distribution of continuous variables.
Used for mapping spatial data encoded as simple features.
Used for showing distributions of individual observations without overlap.
Used for contrasting two mirrored groups across shared categories.
admitted_patients |> # from this plot2 package
plot2(x = age_group,
y = n(),
facet = ward,
type = "back-to-back")admitted_patients |> # from this plot2 package
plot2(x = age_group,
y = n(),
y.limits = c(0, 60),
category = gender,
facet = ward,
type = "back-to-back")Used for depicting flows or transitions between connected stages.
Used for comparing multivariate values across categorical axes arranged radially, enabling pattern recognition and relative magnitude assessment between groups.
# spider plots can have a filling colour, but it's hardly ever useful
diamonds |>
plot2(x = cut,
y = mean(price),
category = color,
type = "spider",
y.labels = dollars,
colour_fill = "viridis")Used for analysing intersections among multiple sets with scalable clarity.
movies |> # from the ggplot2movies package
plot2(x = c(Action, Animation, Comedy, Drama, Romance),
type = "upset")movies |>
plot2(x = c(Action, Animation, Comedy, Drama, Romance),
y = median(rating),
y.title = "Median Rating",
x.sort = TRUE,
type = "upset")