{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "URL: http://matplotlib.org/examples/pie_and_polar_charts/polar_scatter_demo.html" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import holoviews as hv\n", "from holoviews import dim\n", "\n", "hv.extension('matplotlib')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Compute areas and colors\n", "N = 150\n", "r = 2 * np.random.rand(N)\n", "theta = 2 * np.pi * np.random.rand(N)\n", "colors = theta\n", "\n", "scatter = hv.Scatter((theta, r), 'theta', 'r').redim(r=dict(range=(0,2.5)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "scatter.opts(\n", " alpha=0.75, color='theta', cmap='hsv', projection='polar', s=dim('r')*200)" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }