library(ggplot2)
# A line whose width tracks a variable, rescaled to c(0.2, 1.6) automatically.
ggplot(economics[1:120, ], aes(date, unemploy, pressure = unemploy)) +
geom_sketch_line(linewidth = 1, seed = 1L)
# Widen the band for a more dramatic swell.
ggplot(economics[1:120, ], aes(date, unemploy, pressure = unemploy)) +
geom_sketch_line(linewidth = 1, seed = 1L) +
scale_pressure_continuous(range = c(0.05, 2.5))
Run the code above in your browser using DataLab