When you have flipped coordinates, how do you reduce the space between bars that are narrow and the panel border? Using the data frame df and the ggplot
comman
I think I have found a solution. You can remove width
from geom_bar
and introduce theme(aspect.ratio = .2)
, then you can play with the ratio to find the desired width. And unlike coord_equal
or coord_fixed
is compatible with coord_flip
.
ggplot(df, aes(x = x, y = y)) +
geom_bar(stat = "identity") +
theme_tufte() + theme(aspect.ratio = .2) +
coord_flip() +
labs(x = "", y = "")