Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing x-axis label from dendrogram in r

Tags:

plot

r

hclust

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="")

enter image description here

like image 273
Elizabeth Avatar asked Sep 17 '12 16:09

Elizabeth


2 Answers

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="")
like image 62
sgibb Avatar answered Oct 18 '22 15:10

sgibb


May be plot(hc,xlab='', sub="") removes it.

like image 20
Jilber Urbina Avatar answered Oct 18 '22 15:10

Jilber Urbina