plt.figure()
#new point 1
x_features_new1 = np.array([[0,-1]])
plt.scatter(x_features_new1[:,0],x_features_new1[:,1],s=50,cmap='viridis')
plt.annotate(s='New point 1',xy=(0,-1),xytext=(-2,0),color='blue',arrowprops=dict(arrowstyle='-|>',connectionstyle='arc3',color='red'))
When I run above codes in Jupyter Lab,the problem notes as follows:
TypeError Traceback (most recent call last)
C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_13960/202384759.py in <module>
4 x_features_new1 = np.array([[0,-1]])
5 plt.scatter(x_features_new1[:,0],x_features_new1[:,1],s=50,cmap='viridis')
----> 6 plt.annotate(s='New point 1',xy=(0,-1),xytext=(-2,0),color='blue',arrowprops=dict(arrowstyle='-|>',connectionstyle='arc3',color='red'))
7
8 #new point2
TypeError: annotate() missing 1 required positional argument: 'text'
How to solve this problem?