2

I'm looking to make a radar plot in Plotly similar to this one. My current plot looks like this.

It has the default round circular background for polar plots in Plotly, but I would like to change it to a matching hexagon similar to the one I'm modeling after and ideally the inner radial grid as well. I'm not sure how I would go about doing so in Plotly besides removing the background and manually drawing it in with figure.add_shape and drawing individual lines/paths.

Is it possible to do in Plotly or would I be better off using another library?

Code:

import plotly.graph_objects as go

fig = go.Figure()
    fig.add_trace(go.Scatterpolar(r = plotdf.loc[:,i], theta = plotdf.index, mode = 'lines', 
                                  line_width = 2, line_color = 'darkblue', opacity = 0.8))
    fig.update_traces(fill='toself', fillcolor = 'lightblue')
    fig.update_layout(title=dict(text = i, x = 0.5, y = 0.95),
                      polar = dict(
                                   radialaxis_angle = -30,
                                            radialaxis_tickfont_size = 12,
                                            angularaxis_tickfont_size = 16,
                                            angularaxis = dict(direction = 'clockwise', period = 6, gridcolor = 'black', linecolor = 'rgba(0,0,0,0)'),
                                           radialaxis = dict(showgrid = True, showline = False, showticklabels = True, 
                                                             range = (0,100), layer = "above traces")),
                     paper_bgcolor = 'lightgrey')
sen0rpabl0
  • 21
  • 3
  • Do you need the plot to be interactive? – rpanai May 07 '20 at 21:29
  • 1
    No not at the moment, maybe down the line I'd like to add an interactive slider. For now, I've managed to achieve the result I'm looking for using matplotlib and the suggestion [here](https://stackoverflow.com/questions/52910187/how-to-make-a-polygon-radar-spider-chart-in-python) – sen0rpabl0 May 09 '20 at 22:37

0 Answers0