Show Sidebar Hide Sidebar

Radar Charts in Python

How to make radar charts in Python with Plotly.

New to Plotly?

Plotly's Python library is free and open source! Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode, or in jupyter notebooks.
We also have a quick-reference cheatsheet (new!) to help you get started!

Version Check

Plotly's python package is updated frequently. Run pip install plotly --upgrade to use the latest version.

In [1]:
import plotly
plotly.__version__
Out[1]:
'2.4.0'

Basic Radar Chart

In [2]:
import plotly.plotly as py
import plotly.graph_objs as go

data = [go.Scatterpolar(
  r = [39, 28, 8, 7, 28, 39],
  theta = ['A','B','C', 'D', 'E', 'A'],
  fill = 'toself'
)]

layout = go.Layout(
  polar = dict(
    radialaxis = dict(
      visible = True,
      range = [0, 50]
    )
  ),
  showlegend = False
)

fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename = "radar/basic")
Out[2]:

Multiple Trace Radar Chart

In [3]:
import plotly.plotly as py
import plotly.graph_objs as go

data = [
    go.Scatterpolar(
      r = [39, 28, 8, 7, 28, 39],
      theta = ['A','B','C', 'D', 'E', 'A'],
      fill = 'toself',
      name = 'Group A'
    ),
    go.Scatterpolar(
      r = [1.5, 10, 39, 31, 15, 1.5],
      theta = ['A','B','C', 'D', 'E', 'A'],
      fill = 'toself',
      name = 'Group B'
    )
]

layout = go.Layout(
  polar = dict(
    radialaxis = dict(
      visible = True,
      range = [0, 50]
    )
  ),
  showlegend = False
)

fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename = "radar/multiple")
Out[3]:
Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.