Some phenomenon are of an angular nature. An example would be the power of a loudspeaker depending on the angle we measure it from. Polar coordinates are a natural choice to represent such data. Also, cyclic data such as annual or daily statistics can be conveniently plotted in polar coordinates. In this recipe, we are going to see how to work with polar coordinates.
Let's render a simple polar curve as follows:
import numpy as np import matplotlib.pyplot as plt T = np.linspace(0 , 2 * np.pi, 1024) plt.axes(polar = True) plt.plot(T, 1. + .25 * np.sin(16 * T), c= 'k') plt.show()
The following figure shows a specialized layout for polar plots: