Skip to content

Instantly share code, notes, and snippets.

@pitakakariki
Created September 4, 2019 04:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pitakakariki/c5364a5024ff23fe5b4372a922c59ca7 to your computer and use it in GitHub Desktop.
Weird geom_col dodging
X <- data.frame(g=c('a', 'a', 'a', 'b', 'b', 'b'), x=c(1:3, 1:3), y=c(3,0,1,4,0,0))
ggplot(X, aes(x, y, fill=g)) + geom_col(pos='dodge')
ggplot(subset(X, y!=0), aes(x, y, fill=g)) + geom_col(pos='dodge')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment