0

I've got these R plots. How do I make it so that the third's x axis is legible? Here's the partial code to make them.

par(mfrow=c(1,3)) #allows you to have multiple graphs in one window

plot(model2.summary$adjr2,xlab="Number of Variables",ylab="Adjusted R Squared", type="l")
which.max(model2.summary$adjr2) #find the number of variables with the highest adjr2
points(5,model2.summary$adjr2[5],col="red",cex=2,pch=20) # adds a red dot to the adjr2 graph where there is the 
which.min(model2.summary$bic)
plot(model2.summary$bic,xlab="Number of Variables",ylab="BIC",type="l")
points(5,model2.summary$bic[5],col="red",cex=2,pch=20)

plot(model2,scale="adjr2", ylab = "Adjusted R Squared")

I tried to use the code below to tinker with the margins but it didn't work as expected.

par(mar=c(6,4,4,4)+.1)

enter image description here

Eric Tim
  • 53
  • 8
  • 2
    Have you tried increasing the `6` in your `par(mar=.)`? It's the bottom margin, you should be able to expand it to make room for your words. Alternatively, you can try to rotate them (horiz) and alternate the offsets. – r2evans May 10 '21 at 21:43
  • When I increase the 6 it simply pushes the top of the rightmost plot down. :( – Eric Tim May 11 '21 at 13:54
  • 1
    Okay. There's not much to test without a reproducible question (no data). I don't have time to try to generate fake data, but if you can please read https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info and then [edit] your question with sample data (from `dput(.)`). Thanks. – r2evans May 11 '21 at 14:56

0 Answers0