Python 2.7 在matplotlib 3D散射中将一个点置于前端

Python 2.7 在matplotlib 3D散射中将一个点置于前端,python-2.7,matplotlib,scatter3d,Python 2.7,Matplotlib,Scatter3d,我试图在下面的情节中把明星带到最前面。我尝试了zorder,但它不起作用。你有什么建议吗 from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt fig = plt.figure(figsize=(12,6)) ax = fig.gca(projection='3d') ax.zaxis.get_major_formatter().set_useOffset(True) #ax.zaxis.set_rot

我试图在下面的情节中把明星带到最前面。我尝试了zorder,但它不起作用。你有什么建议吗

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

fig = plt.figure(figsize=(12,6))

ax = fig.gca(projection='3d')
ax.zaxis.get_major_formatter().set_useOffset(True)
#ax.zaxis.set_rotate_label(False)
#ax.yaxis.set_rotate_label(False)
#ax.xaxis.set_rotate_label(False)

ax.scatter(optim_index[np.argmin(optim_val)][0], optim_index[np.argmin(optim_val)][1], min(optim_val),
           marker = '*', color = 'green', s=100, zorder=10, label = 'Optimal Solution')
ax.scatter(Plist, Vlist, Objlist, marker = '.', color = 'grey',label='Infeasible Solution')
ax.scatter(Feas_P, Feas_V, Objval, marker = '.', color = 'royalblue', label='Feasible Solution')


ax.view_init(30, 40)
ax.set_xlabel('Laser Power (W)', rotation = 6)
ax.set_ylabel('Scan Speed (mm/s)', rotation = -30)
ax.set_zlabel('Objective Value ($)', rotation = 92)
ax.legend(loc='upper center', bbox_to_anchor=(0.7, 0.8),
          fancybox=True, shadow=False, ncol=1, scatterpoints = 1, fontsize=10)

plt.show() # Deactivate me to save the plot
#plt.savefig('ParamOptim.png', format='png') #dpi=900)  #Activate me to save the plot

如果你最后一次而不是第一次绘制该点,会发生什么?我尝试了所有排序组合。他们没有改变它。我认为这是一个3D问题,甚至不能用zorder解决。周围已经有类似的问题,所以也许有人找到了一个聪明的解决办法,并提供了答案。