<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import numpy as np
import matplotlib.pyplot as plt


theta = np.linspace(0, 2 * np.pi, 201)
r1 = np.abs(np.cos(5.0 * theta) - 1.5 * np.sin(3.0 * theta))
r2 = theta / np.pi
r3 = 2.25 * np.ones_like(theta)
plt.polar(theta, r1, label="trig")
plt.polar(5 * theta, r2, label="spiral")
plt.polar(theta, r3, label="circle")
plt.thetagrids(np.arange(45, 360, 90), ("NE", "NW", "SW", "SE"))
plt.rgrids((0.5, 1.0, 1.5, 2.0, 2.5), angle=290)
plt.legend(loc="best")
plt.show()
</pre></body></html>