doctorjones2355
doctorjones2355

Reputation: 1

How to make a polar plot given r, theta values?

I have a set of (r, theta) values and I want to make a polar plot. Can anyone tell me (or point me to a resource) how to do this? For example the following code represents a circle.


r_array = []
theta_array = []
for i in range(360):
    r_array.append(1)
    theta_array.append(i)

#print (theta_array)

Upvotes: 0

Views: 129

Answers (1)

Antoine Soulier
Antoine Soulier

Reputation: 33

matplotlib seems to do this :

https://matplotlib.org/examples/pylab_examples/polar_demo.html

short example from link below :

import matplotlib.pyplot as plt

r_array = []
theta_array = []
for i in range(360):
    r_array.append(1)
    theta_array.append(i)

ax = plt.subplot(111, projection='polar')
ax.plot(np.radians(theta_array), r_array)

Upvotes: 1

Related Questions