Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- # Generate theta values
- theta = np.linspace(0, 2 * np.pi, 1000)
- # Generate radius values as a sine wave
- sine = 30 + np.sin(6 * theta)
- circle = np.full_like(theta, 30)
- # Create polar plot
- plt.figure()
- ax = plt.subplot(111, projection='polar')
- ax.plot(theta, sine)
- ax.plot(theta, circle)
- # Set the limits for the radial axis
- ax.set_ylim(0, 35)
- # Display the plot
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment