Skip to content

Instantly share code, notes, and snippets.

@zross
Created January 22, 2015 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zross/d5565809c28318e6ca74 to your computer and use it in GitHub Desktop.
Save zross/d5565809c28318e6ca74 to your computer and use it in GitHub Desktop.
Create shooting ribbon plot
# 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