A geom that draws a rug along the x and/or y axis.
Default statistic: stat_identity
Default position adjustment: position_identity
Note that x and y can be used at the same time to draw rugs along both axes.
The following example plot contains three layers. The first layer contains a horizontal rug (in red), the second layer contains a vertical rug (in blue), and the third layer shows the underlying points. The two rugs could also be drawn in the same layer, but then the corresponding x and y lines would have to have the same color.
d=data.frame(x=c(1.5, 2, 5.5, 2.5), y=c(2.5, 3, 6.5, 5.5)) ggplot() + geom_rug(data=d, mapping=aes(x=x), color="red") + geom_rug(data=d, mapping=aes(y=y), color="blue") + geom_point(data=d, mapping=aes(x=x, y=y), color="grey50") + opts(title="geom_rug", plot.title=theme_text(size=40, vjust=1.5))