Reputation: 4040
Here is my ggplot and I need to adjust the spacing between x axis labels and make the plot larger. Please advise what is missing here? Trying to play with expand but without any luck:
ggplot(device_contacts_jaccard_android_ios, aes(x = factor(uuid_lev), y = j, fill = factor(android))) +
geom_boxplot() +
facet_wrap( ~ dt) +
scale_x_discrete(expand=c(0, 0.5)) +
theme(axis.text.x = element_text(angle = -90, hjust = 0))
I have checked other answers here, no one solved my issue, correct me if I am wrong.
Upvotes: 1
Views: 5934
Reputation: 70623
Use ggsave
or pdf(...);...; dev.off()
to increase the output size of the image. Once you do that, the space between axis text labels should increase. You could also decrease the font using element_text(size = 7)
, for example.
Note that in ggsave(..., size, width)
are in inches, by default. Good starting points are width = 8
and height = 8
. If you want to change the units, try ggsave(..., units = "cm")
.
Upvotes: 3