gpt4 book ai didi

R Circlize 和弦图输出

转载 作者:行者123 更新时间:2023-12-04 23:41:17 35 4
gpt4 key购买 nike

我是 R 中的 circlize 包的新手。但是,我的第一个和弦图的输出看起来是椭圆形的,而不是文档示例中所示的圆形。我能做什么?下面的代码和图像。

    #random matrix, for illustration
mat
E1 E2 E3 E4 E5 E6
S1 8 13 18 6 11 14
S2 10 12 1 3 5 7
S3 2 16 4 17 9 15
chordDiagram(mat)

这是我的输出:

This is my output

这就是我想要的:

This is what I want

最佳答案

您需要使用 par(pty="s") 强制平方绘图区域:

library(circlize)

mat <- read.table(text=
",E1,E2,E3,E4,E5,E6
S1,8,13,18,6,11,14
S2,10,12,1,3,5,7
S3,2,16,4,17,9,15",header=TRUE,sep=",",row.names=1)
par(pty="s")
chordDiagram(as.matrix(mat))

diagram

关于R Circlize 和弦图输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37099660/

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