rug(x, …)
Create a set of tick marks along the base of a plot.
  • x – The values at which to create tick marks
  • – Several additional options are available, including the height of the tick marks (ticksize); the side of the plot that tick marks should be placed, where the default is the bottom (side); line width (lwd); color (col); among others.

Example. A histogram of 50 observations is shown. At the base of the plot, we create a rug to see the precise location of each point.
> set.seed(3)
> x <- rbeta(150, 3, 25)
> png("rug.png")
> hist(x)
> rug(quantile(x), col=2, lwd=2.5)
Tip. Creating a rug can be helpful, but don’t overdue it. It may be unclear what specific information is being communicated by a rug if too many tick marks are included.

Leave a Reply