Declare the scale for a mapped (discrete) linetype aesthetic. Levels cycle
through a default set of line types unless values is given. A line-type
legend is drawn automatically. Applies to line-like marks (mark_line(),
mark_step()).
Usage
scale_linetype(
plot,
values = NULL,
name = NULL,
breaks = NULL,
labels = NULL,
limits = NULL,
na.value = NULL,
drop = TRUE
)
scale_linetype_manual(
plot,
values,
breaks = NULL,
labels = NULL,
name = NULL,
limits = NULL,
na.value = NULL,
drop = TRUE
)
scale_linetype_discrete(
plot,
values = NULL,
name = NULL,
breaks = NULL,
labels = NULL,
limits = NULL,
na.value = NULL,
drop = TRUE
)Arguments
- plot
A PlotSpec.
- values
Character vector of line types (each one of
"solid","dashed","dotted","dotdash","longdash","twodash"), orNULLfor the default set. Forscale_linetype_manual()valuesis required, and may also be ggplot2's numeric line types (1solid,2dashed, ...6twodash). Named values are matched to levels by name.- name
Legend title, or
NULLto derive from the encoding.- breaks, labels, limits
As for
scale_shape().- na.value
The line type drawn for missing values, or
NULL.- drop
For the discrete scales, drop factor levels that no row uses (default
TRUE, as in ggplot2): they get no legend key and no palette entry, so the colours go to the levels that remain.FALSEkeeps every level.limitsoverrides it.
Value
The modified PlotSpec.


