Last active
January 22, 2016 10:36
-
-
Save gireeshkbogu/a9e2124ed09787dd18ec to your computer and use it in GitHub Desktop.
Rug plot - an laternative to show a scatter plot with densities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
x<-rnorm(300) | |
y<-rt(300,df=2) | |
xy<-data.frame(x,y) | |
qplot(x,y, data=xy) + | |
scale_x_continuous(limits=c(min(x),max(x))) + | |
scale_y_continuous(limits=c(min(y),max(y))) + | |
geom_rug(col=rgb(.5,0,0,alpha=.2)) | |
Author
gireeshkbogu
commented
Jan 22, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment