我有以下代码:
hc <- hclust(dist(USArrests), "ave")
plot(hc)
plot(hc, hang = 0.5, sub="", xlab ="")
产生以下情节:
如上图所示。我怎样才能push
他们身高标签更正确?
答案 0 :(得分:1)
这可以使用par
的{{1}}参数来完成:
par(mgp=c(2, 1, 0))
plot(hc, hang = 0.5, sub="", xlab ="")
par(mgp=c(1, 1, 0))
plot(hc, hang = 0.5, sub="", xlab ="")
其他两个参数控制刻度线和刻度位置,例如:
par(mgp=c(2, 3, 2))
plot(hc, hang = 0.5, sub="", xlab ="")
答案 1 :(得分:0)
解决方法可能是删除ylab并将其作为文本添加到适当的坐标处,如下所示:
select distinct EQMFSN, WONO
from t
where t.date = (select min(t2.DOCDT8) from t t2);
答案 2 :(得分:0)
也许使用mtext
可以提供帮助
plot(hc, hang = 0.5, sub="", xlab ="", ylab = "")
mtext(text = "test", side = 2, line = 2)
产生这个情节
side = 2
定义左侧,line
表示&#34;偏离度&#34;。您可以使用line
和adj
参数(以及更多)参与其中一些操作:
plot(hc, hang = 0.5, sub="", xlab ="", ylab = "")
mtext(text = "t2", side = 2, line = 2, col = "blue")
mtext(text = "t1", side = 2, line = 1, col = "blue")
mtext(text = "t0", side = 2, line = 0, col = "blue")
mtext(text = "tlow", side = 2, line = 0, col = "blue", adj = 0)
产生以下情节