Answers for "legend.box.spacing ggplot 2"

0

legend.box.spacing ggplot 2

library(ggplot2)

ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + 
  geom_bar() +
  coord_flip() +
  scale_fill_brewer("Cyl", palette = "Dark2") +
  theme_minimal(base_size = 14) +
  theme(legend.position = 'top', 
        legend.spacing.x = unit(1.0, 'cm'))
Posted by: Guest on May-19-2020

Browse Popular Code Answers by Language