p <- ggplot(economics, aes(date, psavert, color = "savings rate"))
# key glyphs can be specified by their name
p + geom_line(key_glyph = "timeseries")
# key glyphs can be specified via their drawing function
p + geom_line(key_glyph = draw_key_rect)
Run the code above in your browser using DataLab