Marginal Plot
Purpose
Marginal Plot is an added feature to the scatter plot which gives the projection of x and y on the respective axis
Rug Plot which shows the marginal and regular plots
> x <- rnorm(1000) > y <- rnorm(1000) > plot(x, y) > rug(x, side = 1, col = "blue") > rug(y, side = 2, col = "blue") |
Rug Plot which shows the marginal and regular plots
> x <- rnorm(1000) > y <- rnorm(1000) > plot(x, y) > rug(jitter(x), side = 1, col = "blue") > rug(jitter(y), side = 2, col = "blue") |
One can use the car package to draw a fancy scatterplot
> library(car) > scatterplot(x ~ y) |