Skip to content

Instantly share code, notes, and snippets.

@ageek
Forked from zross/ribbon
Last active August 29, 2015 14:22
Show Gist options
  • Save ageek/5d157c76413816610c4b to your computer and use it in GitHub Desktop.
Save ageek/5d157c76413816610c4b to your computer and use it in GitHub Desktop.
# 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