But when i am trying rugs are note being created on the left and right side but are created only on the top and bottom.
Add rug plot ggplot2.
A data frame or other object will override the plot data.
Note you can as well add marginal plots to show these distributions.
Create elegant data visualisations using the grammar of graphics.
I also need to create a rugs on the left side of the plot.
As pointed out by csgroen geom rug is the equivalent of rug function.
However your rug vector has a different length from x and y so you have to specify pass some arguments into the aes to ge tthe same figure than the one you get in base r plot.
All objects will be fortified to produce a data frame.
A rug plot is a compact visualisation designed to supplement a 2d display with the two 1d marginal distributions.
If you have too many points you can jitter the line positions and make them slightly thinner.
Description usage arguments details aesthetics examples.
Add add marginal rugs and use jittering to avoid overplotting ggplot iris aes x petal length y petal width geom point geom rug position jitter size 2.
Now iam interested in creating a ggplot income distribution by retirement.
Rug plots display individual cases so are best used with.
Rug plots display individual cases so are best used with smaller datasets.
Geom rug mapping null data null.
By using geom rug you can add marginal rugs to your scatter plot.