{ "nbformat_minor": 0, "nbformat": 4, "cells": [ { "execution_count": null, "cell_type": "code", "source": [ "%matplotlib inline" ], "outputs": [], "metadata": { "collapsed": false } }, { "source": [ "\nPie chart\n=========\n\nA simple pie chart example with matplotlib.\n\n" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "import numpy as np\nimport matplotlib.pyplot as plt\n\nn = 20\nZ = np.ones(n)\nZ[-1] *= 2\n\nplt.axes([0.025, 0.025, 0.95, 0.95])\n\nplt.pie(Z, explode=Z*.05, colors = ['%f' % (i/float(n)) for i in range(n)])\nplt.axis('equal')\nplt.xticks(())\nplt.yticks()\n\nplt.show()" ], "outputs": [], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": "Python 2", "name": "python2", "language": "python" }, "language_info": { "mimetype": "text/x-python", "nbconvert_exporter": "python", "name": "python", "file_extension": ".py", "version": "2.7.12", "pygments_lexer": "ipython2", "codemirror_mode": { "version": 2, "name": "ipython" } } } }