Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 星形打印格式:图形上的键_R_Plot - Fatal编程技术网

R 星形打印格式:图形上的键

R 星形打印格式:图形上的键,r,plot,R,Plot,我想创建六个星-根据输入数据的列命名半径的绘图。frameu。换言之,我希望不使用关键图例,而是将关键名称直接显示在星图上。有没有一种方法可以做到这一点而不必使用par(mfrow)循环通过stars-绘图?谢谢 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 =

我想创建六个
-根据输入数据的列命名半径的绘图。frame
u
。换言之,我希望不使用关键图例,而是将关键名称直接显示在星图上。有没有一种方法可以做到这一点而不必使用
par(mfrow)
循环通过
stars
-绘图?谢谢

 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 )
u=矩阵(runif(60),6,10)

colnames(u)只要稍加修改,你就能找到可行的方法

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
)
sloc