rplotlyradar-chartspider-chart

Plotly Radar Chart from ”circle” to polygon in R


i would like to create a radar chart using plotly but i was wondering if there is any way in R to have sides on the chart instead of being a circle.

I didnt write a code yet, im using the one that is in plotly’s website trying to find the way before implementing it on my data, so i cant attach dput().

I see that the standard output is something like this:

Figure 1: Standard output

And i would like something more likely to this:

Figure 2: Expected Output

EDIT: Attaching a reproducible standard 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
````

Solution

  • SOLVED : Add gridshape = 'linear' to layout(), this worked for me