does anyone know how you can accomplish the task in the title. I want to plot something like displayed in this question.
Thank you for your help!
does anyone know how you can accomplish the task in the title. I want to plot something like displayed in this question.
Thank you for your help!
Got it working with this code here with particles being an array with x, y and angle.
figure, axes = plt.subplots()
axes.set_xlim((0,50))
axes.set_ylim((0,50))
axes.set_aspect(1)
for i in range(M):
axes.add_artist(plt.Circle((particles[i,0], particles[i,1]), 1.5, color='g', alpha=0.5))
plt.title('Circle')
lines = np.empty((M, 2))
for i in range(M):
lines[i,0] = radius*math.cos(particles[i,2]*180/np.pi) + particles[i,0]
lines[i,1] = radius*math.sin(particles[i,2]*180/np.pi) + particles[i,1]
plt.plot([particles[i,0], lines[i,0]], [particles[i,1], lines[i,1]], 'k')
plt.show()