Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 209984

R plotly: How to connect lines on polar/radar chart?

$
0
0

I am creating a polar chart in R with plotly, but I don't want the values between lines to be filled with color. I found the line_close property for python library, but I can't find the equivalent in R.

Chart code:

library(plotly)

p <- plot_ly(
  type = 'scatterpolar',
  mode = 'lines',
) %>%
  add_trace(
    mode = 'lines',
    r = c(3, 0, 1),
    theta = c('A','B','C'),
    name = '1'
  ) %>%
  add_trace(
    mode = 'lines',
    r = c(1, 2, 3),
    theta = c('A','B','C'),
    name = '2'
  ) %>%
  layout(
    polar = list(
      radialaxis = list(
        angle = 90,
        visible = T,
        range = c(0,3),
        showline = F,
        color = '#bfbfbf',
        nticks = 4,
        tickangle = 90
      )
    )
  )

p

Chart image:

enter image description here


Viewing all articles
Browse latest Browse all 209984

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>