Skip to content

Commit 2d4e353

Browse files
committed
exercise 9: switch annotation call to match with rest of the annotations.
The text annotations for cos and sin are now in the same code block as the corresponding scatter-dot and the dashed line.
1 parent 5078cc5 commit 2d4e353

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/exercice_9.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
plt.plot([t,t],[0,np.cos(t)],
3333
color ='blue', linewidth=1.5, linestyle="--")
3434
plt.scatter([t,],[np.cos(t),], 50, color ='blue')
35-
plt.annotate(r'$\sin(\frac{2\pi}{3})=\frac{\sqrt{3}}{2}$',
36-
xy=(t, np.sin(t)), xycoords='data',
37-
xytext=(+10, +30), textcoords='offset points', fontsize=16,
35+
plt.annotate(r'$\cos(\frac{2\pi}{3})=-\frac{1}{2}$',
36+
xy=(t, np.cos(t)), xycoords='data',
37+
xytext=(-90, -50), textcoords='offset points', fontsize=16,
3838
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))
3939

4040
plt.plot([t,t],[0,np.sin(t)],
4141
color ='red', linewidth=1.5, linestyle="--")
4242
plt.scatter([t,],[np.sin(t),], 50, color ='red')
43-
plt.annotate(r'$\cos(\frac{2\pi}{3})=-\frac{1}{2}$',
44-
xy=(t, np.cos(t)), xycoords='data',
45-
xytext=(-90, -50), textcoords='offset points', fontsize=16,
43+
plt.annotate(r'$\sin(\frac{2\pi}{3})=\frac{\sqrt{3}}{2}$',
44+
xy=(t, np.sin(t)), xycoords='data',
45+
xytext=(+10, +30), textcoords='offset points', fontsize=16,
4646
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))
4747

4848
plt.legend(loc='upper left', frameon=False)

0 commit comments

Comments
 (0)