If null the default the data is inherited from the plot data as specified in the call to ggplot.
Ggplot rug plot.
Allowed value is a string containing any of trbl for top right bottom and left.
X.
Description usage arguments details aesthetics examples.
As pointed out by csgroen geom rug is the equivalent of rug function.
The smoothness is controlled by a bandwidth parameter that is analogous to the histogram binwidth.
The following example plot contains three layers.
Add marginal rugs to a scatter plot.
.
The first layer contains a horizontal rug in red the second layer contains a vertical rug in blue and the third layer shows the underlying points.
Most density plots use a kernel density estimate but there are other possible strategies.
A rug plot is a compact visualisation designed to supplement a 2d display with the two 1d marginal distributions.
The function geom rug can be used.
A string that controls which sides of the plot the rugs appear on.
1 opaque transparency of the rug s lines note that x and y can be used at the same time to draw rugs along both axes.
I posted this as follow up to a sibling question with lattice i e.
Note you can as well add marginal plots to show these distributions.
Rug plots display individual cases so are best used with smaller datasets.
Create elegant data visualisations using the grammar of graphics.
A rug plot is a compact visualisation designed to supplement a 2d display with the two 1d marginal distributions.
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.
A data frame or other object will override the.
A rug plot is a compact visualisation designed to supplement a 2d display with the two 1d marginal distributions.
Lattice s panel rug produces different line length with wide plot but due to different graphical system it deserves to be separate.
Rug plots display individual cases so are best used with smaller datasets.
Rug plots display individual cases so are best used with.
Qualitatively the particular strategy rarely matters.
Library library ggplot2 iris dataset head iris plot ggplot data iris aes x sepal length petal length geom point geom rug col.
If null the default the data is inherited from the plot data as specified in the call to ggplot.
Using base graphics a density plot of the geyser duration.
When producing a wide plot in ggplot2 with margins that include geom rug from ggthemes the length of the lines in rugged margins is longer in the y axis than x axis.