I use xlab="" to suppress the x-label but still get a 'sub-x-label' in my dendrogram. How can I remove this and remove any extra space under the dendrogram?
require(graphics)
hc <- hclust(dist(USArrests), "ave")
plot(hc,xlab="")
I use xlab="" to suppress the x-label but still get a 'sub-x-label' in my dendrogram. How can I remove this and remove any extra space under the dendrogram?
require(graphics)
hc <- hclust(dist(USArrests), "ave")
plot(hc,xlab="")
To remove the subtitle use the following:
plot(hc, xlab="", sub="")
To remove the bottom margin (see ?par
for details):
par(mar=c(0, 4, 4, 2)) # c(bottom, left, top, right)
plot(hc, xlab="", sub="")
You need
op <- par(mar = c(2,4,4,2) + 0.1))
plot(hc, xlab = "", sub = "")
par(op)
The first par()
line stores the current settings and then sets the margin to be 2 lines bottom, 4 on the left and top and 2 lines on the right (plus a bit). Then we plot setting an empty string for the *sub*title via argument sub
. Finally we set the parameters back to what they were before the first line.
I left a bit of room on the bottom margin as I'm not sure how far the labels can hand down. Change the first 2
in mar = c(2,4,4,2)
to something smaller if you want less space down the bottom.
© 2022 - 2024 — McMap. All rights reserved.
plot(hc,xlab=NA, sub=NA)
, as explained in the help page for?plot.hclust
– Fleur