1. import matplotlib.pyplot as plt
    2. import numpy as np
    3. fig = plt.figure()
    4. ax = fig.add_subplot(projection="polar", facecolor="lightgoldenrodyellow")
    5. r = np.linspace(0, 3, 301)
    6. theta = 2 * np.pi * r
    7. ax.plot(theta, r, color="tab:orange", lw=3, label="a line")
    8. ax.plot(0.5 * theta, r, color="tab:blue", ls="--", lw=3, label="another line")
    9. ax.tick_params(grid_color="palegoldenrod")
    10. # For polar axes, it may be useful to move the legend slightly away from the
    11. # axes center, to avoid overlap between the legend and the axes. The following
    12. # snippet places the legend's lower left corner just outside of the polar axes
    13. # at an angle of 67.5 degrees in polar coordinates.
    14. angle = np.deg2rad(67.5)
    15. ax.legend(loc="lower left",
    16. bbox_to_anchor=(.5 + np.cos(angle)/2, .5 + np.sin(angle)/2))
    17. plt.show()

    image.png