These geometric element layers (geoms) pair
conventional ggplot2 geoms with stat_rows()
or
stat_cols()
in order to render elements for one or the other
matrix factor of a tbl_ord. They understand the same aesthetics
as their corresponding conventional geoms.
geom_rows_point(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_point(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_path(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
lineend = "butt",
linejoin = "round",
linemitre = 10,
arrow = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_path(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
lineend = "butt",
linejoin = "round",
linemitre = 10,
arrow = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_polygon(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
rule = "evenodd",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_polygon(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
rule = "evenodd",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_density_2d(
mapping = NULL,
data = NULL,
stat = "density_2d",
position = "identity",
...,
contour_var = "density",
lineend = "butt",
linejoin = "round",
linemitre = 10,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_density_2d(
mapping = NULL,
data = NULL,
stat = "density_2d",
position = "identity",
...,
contour_var = "density",
lineend = "butt",
linejoin = "round",
linemitre = 10,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_density_2d_filled(
mapping = NULL,
data = NULL,
stat = "density_2d_filled",
position = "identity",
...,
contour_var = "density",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_density_2d_filled(
mapping = NULL,
data = NULL,
stat = "density_2d_filled",
position = "identity",
...,
contour_var = "density",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_text(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
parse = FALSE,
nudge_x = 0,
nudge_y = 0,
check_overlap = FALSE,
size.unit = "mm",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_text(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
parse = FALSE,
nudge_x = 0,
nudge_y = 0,
check_overlap = FALSE,
size.unit = "mm",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_label(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
parse = FALSE,
nudge_x = 0,
nudge_y = 0,
label.padding = unit(0.25, "lines"),
label.r = unit(0.15, "lines"),
label.size = 0.25,
size.unit = "mm",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_label(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
parse = FALSE,
nudge_x = 0,
nudge_y = 0,
label.padding = unit(0.25, "lines"),
label.r = unit(0.15, "lines"),
label.size = 0.25,
size.unit = "mm",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_text_repel(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
parse = FALSE,
...,
box.padding = 0.25,
point.padding = 1e-06,
min.segment.length = 0.5,
arrow = NULL,
force = 1,
force_pull = 1,
max.time = 0.5,
max.iter = 10000,
max.overlaps = getOption("ggrepel.max.overlaps", default = 10),
nudge_x = 0,
nudge_y = 0,
xlim = c(NA, NA),
ylim = c(NA, NA),
na.rm = FALSE,
show.legend = NA,
direction = c("both", "y", "x"),
seed = NA,
verbose = FALSE,
inherit.aes = TRUE
)
geom_cols_text_repel(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
parse = FALSE,
...,
box.padding = 0.25,
point.padding = 1e-06,
min.segment.length = 0.5,
arrow = NULL,
force = 1,
force_pull = 1,
max.time = 0.5,
max.iter = 10000,
max.overlaps = getOption("ggrepel.max.overlaps", default = 10),
nudge_x = 0,
nudge_y = 0,
xlim = c(NA, NA),
ylim = c(NA, NA),
na.rm = FALSE,
show.legend = NA,
direction = c("both", "y", "x"),
seed = NA,
verbose = FALSE,
inherit.aes = TRUE
)
geom_rows_label_repel(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
parse = FALSE,
...,
box.padding = 0.25,
label.padding = 0.25,
point.padding = 1e-06,
label.r = 0.15,
label.size = 0.25,
min.segment.length = 0.5,
arrow = NULL,
force = 1,
force_pull = 1,
max.time = 0.5,
max.iter = 10000,
max.overlaps = getOption("ggrepel.max.overlaps", default = 10),
nudge_x = 0,
nudge_y = 0,
xlim = c(NA, NA),
ylim = c(NA, NA),
na.rm = FALSE,
show.legend = NA,
direction = c("both", "y", "x"),
seed = NA,
verbose = FALSE,
inherit.aes = TRUE
)
geom_cols_label_repel(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
parse = FALSE,
...,
box.padding = 0.25,
label.padding = 0.25,
point.padding = 1e-06,
label.r = 0.15,
label.size = 0.25,
min.segment.length = 0.5,
arrow = NULL,
force = 1,
force_pull = 1,
max.time = 0.5,
max.iter = 10000,
max.overlaps = getOption("ggrepel.max.overlaps", default = 10),
nudge_x = 0,
nudge_y = 0,
xlim = c(NA, NA),
ylim = c(NA, NA),
na.rm = FALSE,
show.legend = NA,
direction = c("both", "y", "x"),
seed = NA,
verbose = FALSE,
inherit.aes = TRUE
)
geom_rows_axis(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
axis_labels = TRUE,
axis_ticks = TRUE,
axis_text = TRUE,
by = NULL,
num = NULL,
tick_length = 0.025,
text_dodge = 0.03,
label_dodge = 0.03,
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_axis(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
axis_labels = TRUE,
axis_ticks = TRUE,
axis_text = TRUE,
by = NULL,
num = NULL,
tick_length = 0.025,
text_dodge = 0.03,
label_dodge = 0.03,
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_interpolation(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
new_data = NULL,
type = c("centroid", "sequence"),
arrow = default_arrow,
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_interpolation(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
new_data = NULL,
type = c("centroid", "sequence"),
arrow = default_arrow,
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_lineranges(
mapping = NULL,
data = NULL,
stat = "center",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_lineranges(
mapping = NULL,
data = NULL,
stat = "center",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_pointranges(
mapping = NULL,
data = NULL,
stat = "center",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_pointranges(
mapping = NULL,
data = NULL,
stat = "center",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_isoline(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
isoline_text = TRUE,
by = NULL,
num = NULL,
text_dodge = 0.03,
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_isoline(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
isoline_text = TRUE,
by = NULL,
num = NULL,
text_dodge = 0.03,
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_rule(
mapping = NULL,
data = NULL,
stat = "rule",
position = "identity",
axis_labels = TRUE,
axis_ticks = TRUE,
axis_text = TRUE,
by = NULL,
num = NULL,
snap_rule = TRUE,
tick_length = 0.025,
text_dodge = 0.03,
label_dodge = 0.03,
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_rule(
mapping = NULL,
data = NULL,
stat = "rule",
position = "identity",
axis_labels = TRUE,
axis_ticks = TRUE,
axis_text = TRUE,
by = NULL,
num = NULL,
snap_rule = TRUE,
tick_length = 0.025,
text_dodge = 0.03,
label_dodge = 0.03,
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_text_radiate(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_text_radiate(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_rows_vector(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
arrow = default_arrow,
lineend = "round",
linejoin = "mitre",
vector_labels = TRUE,
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_cols_vector(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
arrow = default_arrow,
lineend = "round",
linejoin = "mitre",
vector_labels = TRUE,
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
Set of aesthetic mappings created by aes()
. If specified and
inherit.aes = TRUE
(the default), it is combined with the default mapping
at the top level of the plot. You must supply mapping
if there is no plot
mapping.
The data to be displayed in this layer. There are three options:
If NULL
, the default, the data is inherited from the plot
data as specified in the call to ggplot()
.
A data.frame
, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
fortify()
for which variables will be created.
A function
will be called with a single argument,
the plot data. The return value must be a data.frame
, and
will be used as the layer data. A function
can be created
from a formula
(e.g. ~ head(.x, 10)
).
The statistical transformation to use on the data for this layer.
When using a geom_*()
function to construct a layer, the stat
argument can be used the override the default coupling between geoms and
stats. The stat
argument accepts the following:
A Stat
ggproto subclass, for example StatCount
.
A string naming the stat. To give the stat as a string, strip the
function name of the stat_
prefix. For example, to use stat_count()
,
give the stat as "count"
.
For more information and other ways to specify the stat, see the layer stat documentation.
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The position
argument accepts the following:
The result of calling a position function, such as position_jitter()
.
This method allows for passing extra arguments to the position.
A string naming the position adjustment. To give the position as a
string, strip the function name of the position_
prefix. For example,
to use position_jitter()
, give the position as "jitter"
.
For more information and other ways to specify the position, see the layer position documentation.
Additional arguments passed to ggplot2::layer()
.
Passed to ggplot2::layer()
.
logical. Should this layer be included in the legends?
NA
, the default, includes if any aesthetics are mapped.
FALSE
never includes, and TRUE
always includes.
It can also be a named logical vector to finely select the aesthetics to
display.
If FALSE
, overrides the default aesthetics,
rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. borders()
.
Line end style (round, butt, square).
Line join style (round, mitre, bevel).
Line mitre limit (number greater than 1).
Arrow specification, as created by grid::arrow()
.
Either "evenodd"
or "winding"
. If polygons with holes are
being drawn (using the subgroup
aesthetic) this argument defines how the
hole coordinates are interpreted. See the examples in grid::pathGrob()
for
an explanation.
Character string identifying the variable to contour
by. Can be one of "density"
, "ndensity"
, or "count"
. See the section
on computed variables for details.
If TRUE
, the labels will be parsed into expressions and
displayed as described in ?plotmath
.
Horizontal and vertical adjustment to nudge labels by.
Useful for offsetting text from points, particularly on discrete scales.
Cannot be jointly specified with position
.
If TRUE
, text that overlaps previous text in the
same layer will not be plotted. check_overlap
happens at draw time and in
the order of the data. Therefore data should be arranged by the label
column before calling geom_text()
. Note that this argument is not
supported by geom_label()
.
How the size
aesthetic is interpreted: as millimetres
("mm"
, default), points ("pt"
), centimetres ("cm"
), inches ("in"
),
or picas ("pc"
).
Amount of padding around label. Defaults to 0.25 lines.
Radius of rounded corners. Defaults to 0.15 lines.
Size of label border, in mm.
Amount of padding around bounding box, as unit or number.
Defaults to 0.25. (Default unit is lines, but other units can be specified
by passing unit(x, "units")
).
Amount of padding around labeled point, as unit or
number. Defaults to 0. (Default unit is lines, but other units can be
specified by passing unit(x, "units")
).
Skip drawing segments shorter than this, as unit or
number. Defaults to 0.5. (Default unit is lines, but other units can be
specified by passing unit(x, "units")
).
Force of repulsion between overlapping text labels. Defaults to 1.
Force of attraction between a text label and its corresponding data point. Defaults to 1.
Maximum number of seconds to try to resolve overlaps. Defaults to 0.5.
Maximum number of iterations to try to resolve overlaps. Defaults to 10000.
Exclude text labels when they overlap too many other things. For each text label, we count how many other text labels or other data points it overlaps, and exclude the text label if it has too many overlaps. Defaults to 10.
Limits for the x and y axes. Text labels will be constrained to these limits. By default, text labels are constrained to the entire plot area.
direction of stairs: 'vh' for vertical then horizontal, 'hv' for horizontal then vertical, or 'mid' for step half-way between adjacent x-values.
Random seed passed to set.seed
. Defaults to
NA
, which means that set.seed
will not be called.
If TRUE
, some diagnostics of the repel algorithm are printed
Logical; whether to include labels, tick marks, and text value marks along the axes.
Intervals between elements or number of elements; specify only one.
Numeric; the length of the tick marks, as a proportion of the minimum of the plot width and height.
Numeric; the orthogonal distance of tick mark text from the axis, as a proportion of the minimum of the plot width and height.
Numeric; the orthogonal distance of the axis label from the axis, as a proportion of the minimum of the plot width and height.
A list (best structured as a data.frame)
of row (geom_cols_interpolation()
) or column
(geom_rows_interpolation()
) values to interpolate.
Character value matched to "centroid"
or "sequence"
; the type
of operations used to visualize interpolation.
Logical; whether to include text value marks along the isolines.
Logical; whether to snap rule segments to grid values.
Logical; whether to include labels radiating outward from the vectors.
A ggproto layer.
Other biplot layers:
biplot-stats
,
stat_referent()
,
stat_rows()