I am having trouble running the following code in Jupyter notebook.
import matplotlib.pyplot as plt
import math
plt.axes(projection='polar')
a = 1
n = 6
rads = np.arange(0, (2 * np.pi), 0.01)
for rad in rads:
r = a*np.cos(n*rad)
plt.polar(rad, r, 'g.')
plt.show()
'''
This is my attempt(to be honest, copied it from an online source) to graph a rose curve $r= \cos{6\theta}$.
Thanks for any help.
Welcome to stack! This is a stackoverflow question. Regardless, here's a solution. Maybe it will help you before this post is deleted. You have two major issues. First, you're making many plots, not one. Each iteration of your for loop produces a plot. Second, you're making a polar projection of a polar plot, which is not necessary. Just make one polar plot.