{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/vnd.plotly.v1+html": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly\n", "import plotly.graph_objs as go\n", "plotly.offline.init_notebook_mode(connected=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Basic Radar Chart" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "linkText": "Export to plot.ly", "plotlyServerURL": "https://plot.ly", "showLink": true }, "data": [ { "fill": "toself", "name": "Group A", "r": [ 39, 28, 8, 7, 28, 39 ], "theta": [ "A", "B", "C", "D", "E", "A" ], "type": "scatterpolar", "uid": "c020ecab-86d1-431d-b944-21e3ac8fd0a3" }, { "fill": "toself", "name": "Group B", "r": [ 1.5, 10, 39, 31, 15, 1.5 ], "theta": [ "A", "B", "C", "D", "E", "A" ], "type": "scatterpolar", "uid": "7a262f24-0679-474e-b6d1-21ef9c9130ac" } ], "layout": { "polar": { "radialaxis": { "range": [ 0, 50 ], "visible": true } }, "showlegend": false } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "data = [\n", " go.Scatterpolar(\n", " r = [39, 28, 8, 7, 28, 39],\n", " theta = ['A','B','C', 'D', 'E', 'A'],\n", " fill = 'toself',\n", " name = 'Group A'\n", " ),\n", " go.Scatterpolar(\n", " r = [1.5, 10, 39, 31, 15, 1.5],\n", " theta = ['A','B','C', 'D', 'E', 'A'],\n", " fill = 'toself',\n", " name = 'Group B'\n", " )\n", "]\n", "\n", "layout = go.Layout(\n", " polar = dict(\n", " radialaxis = dict(\n", " visible = True,\n", " range = [0, 50]\n", " )\n", " ),\n", " showlegend = False\n", ")\n", "fig = go.Figure(data=data, layout=layout)\n", "plotly.offline.iplot(fig, filename = \"radar\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }