Skip to content

Instantly share code, notes, and snippets.

@janbenetka
Created June 22, 2021 09:08
Show Gist options
  • Save janbenetka/2a672a06f615490bc6f30ef01ba79438 to your computer and use it in GitHub Desktop.
Save janbenetka/2a672a06f615490bc6f30ef01ba79438 to your computer and use it in GitHub Desktop.
[Polar/Radar plot in plotly] #plotly
import plotly.graph_objects as go
categories = ['accommodation','financial','tourism',
'shopping', 'food&drinks']
fig = go.Figure()
fig.add_trace(go.Scatterpolar(
r=[1, 5, 2, 2, 3],
theta=categories,
fill='toself',
name='Product A'
))
fig.add_trace(go.Scatterpolar(
r=[4, 3, 2.5, 1, 2],
theta=categories,
fill='toself',
name='Product B'
))
fig.update_layout(
polar=dict(
radialaxis=dict(
visible=True,
range=[0, 5]
)),
showlegend=False
)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment