How do I make a quiver plot in polar coordinates? I have data in terms of r and theta. I've tried:
import numpy as np
radii = np.linspace(0.5,1,10)
thetas = np.linspace(0,2*np.pi,20)
theta, r = np.meshgrid(thetas, radii)
f = plt.figure()
ax = f.add_subplot(111, polar=True)
ax.quiver(theta, r, dr, dt)
where dr and dt are vectors of data in the r and theta directions.
Quiver Plot with two arrows Let's add another arrow to the plot passing through two starting points and two directions. By keeping the original arrow starting at origin(0, 0) and pointing towards up and to the right direction(1, 1), and create the second arrow starting at (0, 0) pointing down in direction(0, -1).
Rules for Drawing Polar PlotsWrite the expressions for magnitude and the phase of G(jω)H(jω). Find the starting magnitude and the phase of G(jω)H(jω) by substituting ω=0. So, the polar plot starts with this magnitude and the phase angle. Find the ending magnitude and the phase of G(jω)H(jω) by substituting ω=∞.
A quiver plot is a type of 2D plot that shows vector lines as arrows. Quiver plots are useful in electrical engineering to visualize electrical potential and valuable in mechanical engineering to show stress gradients.
quiver( U , V ) plots arrows with directional components specified by U and V at equally spaced points. If U and V are vectors, then the x-coordinates of the arrows range from 1 to the number of elements in U and V , and the y-coordinates are all 1.
It looks like quiver does not do the conversion for you. You need to do the (r,t) -> (x,y) conversion by hand:
radii = np.linspace(0.5,1,10)
thetas = np.linspace(0,2*np.pi,20)
theta, r = np.meshgrid(thetas, radii)
dr = 1
dt = 1
f = plt.figure()
ax = f.add_subplot(111, polar=True)
ax.quiver(theta, r, dr * cos(theta) - dt * sin (theta), dr * sin(theta) + dt * cos(theta))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With