Skip to content

Instantly share code, notes, and snippets.

@pbiecek
Created January 18, 2015 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbiecek/5e8eccab86a54b527049 to your computer and use it in GitHub Desktop.
Save pbiecek/5e8eccab86a54b527049 to your computer and use it in GitHub Desktop.
tab <- as.data.frame(table(studenci$CNT))
names(tab) <- c('Kraje','N')
summary(tab$N)
tab$Kolor <- as.factor(ifelse(tab$Kraje=='Poland',1,2))
ggplot(data = tab,
aes(x = reorder(Kraje,N),
y = N,
fill = Kolor)) +
geom_bar(stat='identity',
colour='black') +
theme_bw() +
theme(axis.text.x = element_text(angle=90,hjust=1,vjust=1,size=8),
legend.position='none') +
xlab('Kraje') +
ylab('Liczba wylosowanych studentów') +
scale_fill_manual(values = c('red','white'),
breaks = 1:2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment