library("ggplot2")
p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() +
scale_x_continuous(breaks = extended_range_breaks()(mtcars$wt)) +
scale_y_continuous(breaks = extended_range_breaks()(mtcars$mpg)) +
ggtitle("Cars")
p + geom_rangeframe() +
coord_cartesian(clip="off") +
theme_tufte()
p + geom_rug() +
theme_tufte(ticks = FALSE)
Run the code above in your browser using DataLab