Home > database >  Adjust position x-axis title
Adjust position x-axis title

Time:07-02

I would like to adjust the position of the x-axis title of my generated graph. Note that the word titlex is way below the graph, however I would like to adjust it higher. How to do this?

data(USArrests)
titlex <- dist(scale(USArrests), method = "euclidean")
hc <- hclust(titlex, method = "ward.D2")
plot(hc)

enter image description here

CodePudding user response:

Alternative would be to remove the line for xlab through the title function.

plot(hc, xlab="")
title(xlab = "titlex", line = 0) 

enter image description here

  •  Tags:  
  • r
  • Related