.. _pylab_examples-polar_demo:

pylab_examples example code: polar_demo.py
==========================================



.. plot:: /build/matplotlib-Gi1JJZ/matplotlib-1.5.1/doc/mpl_examples/pylab_examples/polar_demo.py

::

    """
    Demo of a line plot on a polar axis.
    """
    import numpy as np
    import matplotlib.pyplot as plt
    
    
    r = np.arange(0, 3.0, 0.01)
    theta = 2 * np.pi * r
    
    ax = plt.subplot(111, projection='polar')
    ax.plot(theta, r, color='r', linewidth=3)
    ax.set_rmax(2.0)
    ax.grid(True)
    
    ax.set_title("A line plot on a polar axis", va='bottom')
    plt.show()
    

Keywords: python, matplotlib, pylab, example, codex (see :ref:`how-to-search-examples`)