擅长:python、mysql、java
<p>使用<a href="https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.arrow.html" rel="noreferrer">^{<cd1>}</a>:</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
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', length_includes_head=True)
plt.show()
</code></pre>
<p><a href="https://i.stack.imgur.com/1nXzQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1nXzQ.png" alt="enter image description here"/></a></p>