Matplotlib - Tracer un plan et les points en 3D simultanément

Je m en essayant de tracer simultanément un avion et quelques points en 3D avec Matplotlib.
Je n'ai pas d'erreurs juste le point n'apparaît pas.
Je peux parcelle, à différents moments, certains points et d'avions, mais jamais au même moment.
La partie du code ressemble à ceci :

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

point  = np.array([1, 2, 3])
normal = np.array([1, 1, 2])

point2 = np.array([10, 50, 50])

# a plane is a*x+b*y+c*z+d=0
# [a,b,c] is the normal. Thus, we have to calculate
# d and we're set
d = -point.dot(normal)

# create x,y
xx, yy = np.meshgrid(range(10), range(10))

# calculate corresponding z
z = (-normal[0] * xx - normal[1] * yy - d) * 1. /normal[2]

# plot the surface
plt3d = plt.figure().gca(projection='3d')
plt3d.plot_surface(xx, yy, z, alpha=0.2)


#and i would like to plot this point : 
ax.scatter(point2[0] , point2[1] , point2[2],  color='green')

plt.show()
  • Connexes : stackoverflow.com/questions/13464304/...
  • comment est-ce lié? La question que votre lien est sur matlab, c'est sur matplotlib
  • Hey @tom, il a une explication sur le calcul de la formule, celle qui est appelée "Calculer correspondant z' dans la question d'origine
  • Ok bien sûr, même si ce n'est pas vraiment ce que cette question et les réponses sont sur le
InformationsquelleAutor user3601754 | 2016-03-17