I am plotting bar plots and box plots using boxplot
and barplot
in R, and space is tight. I every bar / box to be labelled visibly, but R automatically hides labels that it reckons will make the display too cramped.
axis()
has the parameter gap.axis
. Is there an equivalent for boxplot
and barplot
?
Plotting barplot(..., axes = FALSE); axis(1, gap.axis = 0)
doesn't work because the position of the x axis doesn't correspond to the position of bars.
Reproducible example:
boxplot(matrix(1:100, 10, 10), cex.axis = 2)
barplot(setNames(1:10, 1:10), cex.names = 2)