Image Formatting: Keys on Charts

I would like to create six stars-planes with radii named according to the .frame input columns u. In other words, I would like to do without a key legend and have the key names directly on the stars themselves. Is there a way to do this without scrolling through stars-planes using par(mfrow)? Thank.

 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 )
+4
source share
1 answer

With a little mess, you can get to something workable.

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
)

Result:

enter image description here

You can delete the entire row for each segment by specifying lty=0, but this leaves numbers floating out of space is not easy.

+2
source

Source: https://habr.com/ru/post/1547676/


All Articles