You are reading an old version of the documentation (v1.4.3). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

pylab_examples example code: plotfile_demo.py

Next topic

pylab_examples example code: polar_legend.py

This Page

pylab_examples example code: polar_demo.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/polar_demo.png
"""
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, polar=True)
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 Search examples)