0

I am using ggplot to create a bar chart. I am showing the count of entries with 1/0 to property_floodng, differentiated with fill by hurricane exposure, and split into time 1 and time 2.

ggplot(survey_nonmovers, aes(factor(property_flooding), fill = factor(hurricanes))) +
  geom_bar(position = "dodge2", width = 0.9) +
  facet_wrap(facets = vars(C0_time)) +
  labs(subtitle = "Differentiated by Time and Hurricane Exposure")

enter image description here

The problem is there were more hurricanes by time 2, so the left panel has 0 or 1 hurricanes, while the right panel has 0-3 hurricanes. I would still like the bars in each side to be the same. However, even when I add a width value, the ones on the right where there are more hurricanes are skinnier than the ones of the left. Can I fix this?

divibisan
  • 10,372
  • 11
  • 36
  • 56
tchoup
  • 769
  • 1
  • 7

0 Answers0