.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_misc_fill_spiral.py: =========== Fill Spiral =========== .. image:: /gallery/misc/images/sphx_glr_fill_spiral_001.png :class: sphx-glr-single-img .. code-block:: default import matplotlib.pyplot as plt import numpy as np theta = np.arange(0, 8*np.pi, 0.1) a = 1 b = .2 for dt in np.arange(0, 2*np.pi, np.pi/2.0): x = a*np.cos(theta + dt)*np.exp(b*theta) y = a*np.sin(theta + dt)*np.exp(b*theta) dt = dt + np.pi/4.0 x2 = a*np.cos(theta + dt)*np.exp(b*theta) y2 = a*np.sin(theta + dt)*np.exp(b*theta) xf = np.concatenate((x, x2[::-1])) yf = np.concatenate((y, y2[::-1])) p1 = plt.fill(xf, yf) plt.show() .. _sphx_glr_download_gallery_misc_fill_spiral.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: fill_spiral.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: fill_spiral.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_