在 R 中绘制从“圆形”到多边形的雷达图

问题描述 投票:0回答:1

我想使用plotly创建雷达图,但我想知道R中是否有任何方法可以在图表上有边而不是圆形。

我还没有编写代码,我正在使用plotly网站上的代码,试图在我的数据上实现它之前找到方法,所以我无法附加 dput()。

我看到标准输出是这样的:

Figure 1: Standard output

我想要更有可能的东西:

Figure 2: Expected Output

编辑:附加可重现的标准输出

````
library(plotly)

fig <- plot_ly(
    type = 'scatterpolar',
    r = c(39, 28, 8, 7, 28, 39),
    theta = c('A','B','C', 'D', 'E', 'A'),
    fill = 'toself'
  ) 
fig <- fig %>%
  layout(
    polar = list(
      radialaxis = list(
        visible = T,
        range = c(0,50)
      )
    ),
    showlegend = F
  )

fig
````
r plotly radar-chart spider-chart
1个回答
0
投票

已解决:将

gridshape = 'linear'
添加到
layout()
,这对我有用

© www.soinside.com 2019 - 2024. All rights reserved.