I have been attempting to tilt my x axis labels to 45 degrees. Currently when I run the program, all the titles are stacked on top of each other at each axis.
I expected my code to display my x axis labels at a 45 degree angle, one label per tick, not every label on every tick.
boxplot(x ~ y, data=df, pars=list(xaxt="n") ## boxplot with x axis labels eliminated
axis(1, at=seq(1, 15, by=1), labels=FALSE) ## x axis ticks with no labels
text(seq(1, 15, by=1), par("usr")[3] - 1, labels=df$name, srt=45, pos=1, xpd=TRUE) ## x axis labels at 45 degrees, but they are stacked on top of each other.
Do I need to relabel my dataset, specifically in the df$name? Does the labels=df$name
have too many names, which stack on top of each other?
This code is from this source: https://stats.oarc.ucla.edu/r/faq/how-can-i-change-the-angle-of-the-value-labels-on-my-axes/