I am trying to plot a unit vector in a unit circle.
here is the code
vunit = 1/np.sqrt(2)
vec1 = [vunit,vunit]
thetas = np.arange(-np.pi, np.pi, .05)
coordinates = np.vstack((np.cos(thetas),np.sin(thetas)))
plt.figure(figsize = (6,6))
plt.xlim(-3,3)
plt.ylim(-3,3)
plt.scatter(coordinates[0,:],coordinates[1,:],s=.1)
plt.arrow(0, 0, vec1[0], vec1[1], head_width=0.15, color='r')
everything is OK, except the head of arrow is outside the circle.
so, I modify the vec1 ugly
vec1 = [vunit-.1,vunit-.1]
the figure looks better and I can modify the vec1 more finely, but the fix seem to be ugly. is there a way to have the arrow inside the circle elegantly




