gpt4 book ai didi

r - 星图格式 : keys on the graphs

转载 作者:行者123 更新时间:2023-12-01 03:48:45 24 4
gpt4 key购买 nike

我想创建六个 stars -根据输入数据的列命名的半径图。框架u .换句话说,我希望没有关键图例,而是直接在星图上使用关键名称。有没有办法在不遍历 stars 的情况下做到这一点? - 使用 par(mfrow) 绘图?谢谢。

 u = matrix(runif(60),6,10)
colnames(u) <- as.character(1:10)
stars( u , locations = NULL , key.loc = c(0,0) , labels=1:6,
key.labels = colnames(u) , col.lines=1:10, lwd=2 )

最佳答案

稍微摆弄一下,您就可以找到可行的方法。

sloc <- stars(u,len=0.6,lwd=2, col.lines=1:10)

Map(
function(x,y) stars(
matrix(1,ncol=10,nrow=6),key.loc=c(x,y),
key.labels=colnames(u),add=TRUE, lty=3, cex=0.7, len=0.6
),
sloc$Var1, sloc$Var2
)

结果:

enter image description here

您可以通过指定 lty=0 完全删除每个段的行。 ,但这会使数字笨拙地漂浮在空间中。

关于r - 星图格式 : keys on the graphs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24643860/

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