Rug plot along one axis

451 views
Skip to first unread message

Rob

unread,
Apr 26, 2011, 12:28:27 AM4/26/11
to ggplot2
Hi - I'm plotting some data (geom_line), and would like to rug a
subset along the x-axis. How can I restrict geom_rug to just one axis,
and to just observations with some flag (e.g. important.point = TRUE)?

Thanks!

Allan

unread,
Apr 26, 2011, 11:16:37 AM4/26/11
to ggplot2
library(ggplot2)
ggplot(mtcars, aes(x=wt, y=mpg)) +
geom_line() +
geom_rug(subset = .(wt < 3, cyl == 4), aes(y = NULL))

# see ?quoted for more on the subset argument
Reply all
Reply to author
Forward
0 new messages