gpt4 book ai didi

r - hclust 图中的 ylim

转载 作者:行者123 更新时间:2023-12-01 09:29:10 24 4
gpt4 key购买 nike

我有这个简单的代码来绘制树状图,但功能 ylim似乎不起作用。所以无论我如何设置它,它在绘制时都有一个 [0,0.5] 的 y 范围。

绘制树状图时,我应该使用另一个参数来设置 ylim 吗?

plot(hclust(total_dist),main=NULL,ylab=NULL,ylim=c(0,1))

enter image description here

最佳答案

您可以使用 as.dendrogram :

hc <- hclust(dist(USArrests)/200, "ave")
plot(hc)
plot(hc, ylim = c(0,1)) # negative case
plot(as.dendrogram(hc))
plot(as.dendrogram(hc), ylim = c(0,1)) # positive case

关于r - hclust 图中的 ylim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17925073/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com