Created
January 22, 2015 16:20
-
-
Save zross/d5565809c28318e6ca74 to your computer and use it in GitHub Desktop.
Create shooting ribbon plot
This file contains 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
# quick example of creating a plot like that at the link below | |
# http://www.visualisingdata.com/index.php/2015/01/make-grey-best-friend/ | |
x<-1:10 | |
y<-x^2 | |
z<-x | |
radius<-x/5 | |
dat<-data.frame(x=x, y=y, z=z, radius=radius) | |
ggplot(dat, aes(x,y))+ | |
geom_ribbon(aes(ymin=y-radius, ymax=y+radius), alpha=0.5, fill="grey", color="grey", size=1)+ | |
geom_point(aes(size=z), shape=21, color="grey50", fill="red") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment