0

R代码输出 5star glyphs但我无法控制它们的位置:

stars(mtcars[1:5, 1:4], key.loc = c(6, 0.5),
      main = "Example of 4 glyph stars", labels= NULL, flip.labels = FALSE)

我想使用散点图上的 5 对 (x,y) 坐标来定位每个字形ggplot2

4

1 回答 1

1

不确定如何使用 ggplot 进行操作,但stars可以使用locations. 见下文:

x_s <- 1:5
y_s <- 1:5
loc <- data.frame(x = x_s, y = y_s)

stars(mtcars[1:5, 1:4], key.loc = c(5, 0), locations = loc,
  main = "Example of 4 glyph stars", labels = NULL, flip.labels = FALSE)
于 2018-08-24T17:28:51.120 回答