I have this 3D graph
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.patches import FancyArrowPatch
from mpl_toolkits.mplot3d import proj3d
t = np.linspace(0,2*np.pi, 40)
# Position equations
def rx(t):
return t * np.cos(t)
def ry(t):
return t * np.sin(t)
fig = plt.figure(figsize=(10,10))
axes = fig.gca(projection='3d')
While the graph works, I'm trying to label t
at certain points in my graph but it is not showing up.
For example, trying to label t=2pi/3 as a text.
axes.plot(rx(t), ry(t), t, c='k')
axes.annotate(r'$t = 3 \pi/2$', xy=(rx(3*np.pi/2), ry(3*np.pi/2))
plt.xlim(-2*np.pi,2*np.pi)
plt.ylim(-6,6)
plt.show
Does anyone know how to fix this problem?