You are reading an old version of the documentation (v3.1.1). For the latest version see https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_demo.html
Version 3.1.2
matplotlib
Fork me on GitHub

Table of Contents

Related Topics

Polar Demo

Demo of a line plot on a polar axis.

import numpy as np
import matplotlib.pyplot as plt


r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r

ax = plt.subplot(111, projection='polar')
ax.plot(theta, r)
ax.set_rmax(2)
ax.set_rticks([0.5, 1, 1.5, 2])  # Less radial ticks
ax.set_rlabel_position(-22.5)  # Move radial labels away from plotted line
ax.grid(True)

ax.set_title("A line plot on a polar axis", va='bottom')
plt.show()
../../_images/sphx_glr_polar_demo_001.png

References

The use of the following functions, methods, classes and modules is shown in this example:

Out:

<function PolarAxes.set_rlabel_position at 0x7fb11b4232f0>

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery