I'm trying to plot 3d surface with text.
For example let's consider surface described by eq. z = 1:
import matplotlib.pyplot as plt
import numpy as np
x = np.array([0, 1])
y = np.array([0, 1])
X,Y = np.meshgrid(x,y)
Z = np.ones((2,2))
# Create a 3D plot
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
# Plot the surface
ax.plot_surface(X, Y, Z, alpha=0.7)
# Set the labels
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
# Show the plot
plt.show()
Further I would like to add text to this surface at the coordinate (0.5,0.5,1). Text should printed strictly on this surface and oriented at an angle of 45 like that:
Unfortunately, I haven't found any satisfactory solution of this problem in matplotlib functional. I tried simple ax.text(0.5,0.5,1, "Text", fontsize = 20), but it's far from the result I'm trying to achieve. (Text nether belongs to the surface nor has the proper orientation, see below)
Please, help me!


