I am having a little problem in generating a cluster dendrogram.
The cluster technique is working, the question is just the graph. I would like to make minor adjustments to it.
The distance between the names on the X axis and the end of the lines with the divisions of the group is huge and covering a large part of the graph unnecessarily, I would very much like to decrease that (green markings on the image). As a result, I would like the scale on the Y axis to increase (blue markings on the image).
Would anyone know how to solve this? I searched the documentation for rect.hclust and found no arguments to make these adjustments.
To facilitate understanding, I attach the script and image of the generated dendrogram and what I would like to happen.
Thank you so much for your attention (and help)!
pts <- read_excel("C:/pts.xlsx")
row.names(pts) <- c("Painting","Dance","Photo", "Cinema","Book","Music")
matrix = dist(pts, "euclidean")
group = hclust(matrix, "ward.D")
hcd <- as.dendrogram(group)
dend_data <- dendro_data(hcd, type = "rectangle")
plot(group, hang=-1)
rect.hclust(group, k=3, border="red")