I am trying to add a point on a surface displayed with the function plot_trisurf. The point is present, but seems to be drawn before the surface, so that the only way to see it is to make the surface transparent. I would like this point to appear on the surface even if the surface is not transparent. Do you have any idea of how to do that ?
An example of the problem would be the following :
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as plt
Latitude = np.repeat(np.linspace(45.1525, 45.17, 1000), 15)
Longitude = np.array(list(np.linspace(5.9, 5.94, 1000))*15)
x = np.linspace(0,3,len(Latitude))
Altitude = np.sin(x)*np.cos(x**2)
fig = plt.figure(figsize=(15, 9))
ax = fig.gca(projection="3d")
ax.view_init(30, 250)
surf = ax.plot_trisurf(
Latitude,
Longitude,
Altitude,
cmap=plt.cm.jet,
linewidth=0,
alpha=0.2,
edgecolor=None,
antialiased=False,
)
s = ax.scatter(
Latitude[10600],
Longitude[10600],
Altitude[10600],
c="black",
marker="*",
s=100,
depthshade=False,
)
plt.title((Latitude[10600], Longitude[10600], Altitude[10600]))
plt.show()
I also tried with scatter3D, and by increasing a little the altitude of the point with respect to the surface but nothing worked.
Thanks a lot for your help !