I am wondering if there is a way to plot a bar indicating the distribution and the cutoff value like below.
pic from https://ig.ft.com/us-election-2020/
I have got
attitude <- c('solid_blue', 'leaning_blue', 'toss_up', 'leaning_red', 'solid_red') n_votes <- c(190, 108, 121, 39, 80) group <- c(1,1,1,1,1) df <- rbind(attitude, n_votes, group) df <- as.data.frame(t(df)) ggplot(data = df) + geom_bar(stat = 'identity', mapping = aes (x = group, y = n_votes, fill = attitude)) + coord_flip()
The n_votes does not seem to accumulate correctly, how can I correct this?