Graphics Reference
In-Depth Information
Adding Marginal Rugs to a Scatter Plot
Problem
You want to add marginal rugs to a scatter plot.
Solution
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()