spider chart in python using px.express code example
Example: spider chart in python using px.express
fig = go.Figure()
for i in range(3):
fig.add_trace(
go.Scatterpolar(
r=avg_iris.loc[i].values.tolist() + avg_iris.loc[i].values.tolist()[:1],
theta=avg_iris.columns.tolist() + avg_iris.columns.tolist()[:1],
name="IRIS-%s"%iris.target_names[i],
showlegend=True,
)
)
fig.update_layout(
polar=dict(
radialaxis=dict(
visible=True,
range=[0, 1]
)
),
title="IRIS Flower Variables According to Flower Categories"
)
fig.show()