0

I am making a plot with a few levels in the variable Code and 3 Levels in the variable Statut.

Now I want all bars to be the same size even if there are fewer levels of code for the Statut not yet started. How can I do this?

enter image description here

ggplot(data = df_incoming, aes(x = Statut, fill = Code)) +
  geom_bar(position = "dodge", aes(y = count)) +
  labs(x = "Statut", y = "Aantal") +
  scale_fill_manual(values = brewer.pal(12, "Set3")) +
  theme_minimal()
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    I think replace `position="dodge"` with `position=position_dodge(preserve="single")` – qdread Jul 10 '23 at 14:27
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jul 10 '23 at 14:32

0 Answers0