1

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()

Which produces: enter image description here

The issue in the top-left corners is more visible with thicker borders, for example...

enter image description here

Is there some way to prevent this from happening, i.e. have a smooth continuous border? Thanks in advance for any help!

Lyam
  • 123
  • 2
  • 14
  • 2
    It's the same issue as discussed [here](https://stackoverflow.com/questions/53767758/geom-tile-border-missing-at-corners). Update to the development version of `ggplot2` and that should fix it: `devtools::install_github("tidyverse/ggplot2")`. – Dan Jun 14 '19 at 12:48

0 Answers0