Polar Plots

Polar plots draw polar coordinate values: a radius at a given angle. Polar plots are commonly used to draw antenna radiation patterns, as they depict the energy the antenna transmits at any given angle. Polar plots are implemented using the polar(theta, r) function.

To set the labels along the radius, use the rgrids(radii, labels) function, which works similarly to xticks() and yticks(). If you don't provide the labels value, the radii values are used as labels. You can also set the angle at which the labels are plotted (the default is 22.5 degrees). Similarly, the function thetagrids() plots the angle ticks and labels, as demonstrated in Listing 6-11.

Listing 6-11. A Polar Plot theta = arange(o, 2*pi, O.Ol) polar(theta, cos(theta), theta, -cos(theta)) rgrids([0.5, 1.0], ['Half', 'Full'])

theta_labels = ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3*\pi}{2}$'] thetagrids(arange(o, 360, 90), theta_labels) title(r'A polar plot of $\pm cos(\theta)$')

Figure 6-13 shows the resulting polar plot. A polar plot of ± cos(d)

Polar Plot Thetagrid
Figure 6-13. Polar plot

In the title, I've used the ± symbol denoted by '$\pm$'.

Was this article helpful?

0 0

Post a comment