I want to add some text to a 3D wireframe plot. I am starting with the code from this example in the matplotlib gallery. From the Axes
documentation I found a text()
. If I'm reading this correctly, there are 4 required positional arguments (including self
). I modified the example as follows:
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Grab some test data.
X, Y, Z = axes3d.get_test_data(0.05)
# Plot a basic wireframe.
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
ax.text(0, 0, "I'm here")
plt.show()
When I run this code, I get
TypeError: text() missing 1 required positional argument: 's'
How do I fix this? What am I doing wrong here?