I've encountered a problem when plotting bar charts with borders in ggplot2. The borders do not connect properly at some of the corners (specifically the top-left corner of each bar), leading to weird looking graphs. Here's the code I'm using:
dat1 <- data.frame(
time = factor(c("Lunch","Dinner","Lunch","Dinner"), levels=c("Lunch","Dinner")),
total_bill = c(13.53, 16.81, 16.24, 17.42)
)
ggplot(data=dat1, aes(x=time, y=total_bill, fill=time)) +
geom_bar(stat="identity", position=position_dodge(), colour="black" ) +
scale_fill_manual(values=c('white','white')) +
theme_classic()
The issue in the top-left corners is more visible with thicker borders, for example...
Is there some way to prevent this from happening, i.e. have a smooth continuous border? Thanks in advance for any help!