I always have this problem when plotting with matplotlib... they have no concept of drawing the axis lines on the plot, in this case, I specifically want xyz axis lines drawn on a scatter plot so that it looks like the attached photo, including the project lines from the point back to the axis.
ploting a point with explicit axis lines through origin
instead this is what i get:
# from jupyter notebook
%matplotlib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter( 1, 1, 1, c='r', marker='o')
ax.scatter( 1, -1, 1, c='b', marker='o')
ax.scatter(-1, 1, -1, c='g', marker='o')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
ax.set_xlim(-2,2)
ax.set_ylim(-2,2)
ax.set_zlim(-2,2)
#ax.set_xticks(np.arange(-2, 2, 1))
#ax.set_yticks(np.arange(-2, 2, 1))
#ax.set_zticks(np.arange(-2, 2, 1))
plt.show()