Graphics Reference
In-Depth Information
Adding Marginal Rugs to a Scatter Plot
Problem
You want to add marginal rugs to a scatter plot.
Solution
Use geom_rug() . For this example ( Figure 5-28 ), we'll use the faithful data set, which con-
tains data about the Old Faithful geyser in two columns— eruptions , which is the length of
each eruption, and waiting , which is the length of time to the next eruption:
ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_point() + geom_rug()
Search WWH ::




Custom Search