scale_length_continuous() provides a continuous scale for controlling the
length aesthetic in a ggplot. This is particularly useful when working with
vector plots where vector lengths are mapped to a continuous scale.
Arguments
- max_range
The length, in centimeters, of the longest vector. Every other vector is drawn in proportion to it, so a vector with half the largest norm is half as long, and the legend shows the same lengths. Defaults to
0.5. With a transformation that makes some values negative, such astransform = "log10"with norms below 1, lengths instead run from a tenth ofmax_rangefor the smallest value tomax_rangefor the largest, so they still grow with the norm and no vector is reversed.- ...
Other arguments passed to
continuous_scale(), such astransform.
Value
If max_range is less than or equal to 0.5 (the default), a
continuous scale object (typically of class "ScaleContinuous")
mapping the length aesthetic is returned. If max_range is
greater than 0.5, a list is returned with two components:
the continuous scale object, and
a theme modification (a
themeobject) that adjusts the legend key width based on the value ofmax_range.