I am drawing a 3d graph with matplotlib and trying to change the order of some scatters with the attribute "zorder". The object with the highest zorder should be placed on top, but it failed. Here is my code:
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(projection= '3d')
coorx = [1,2,3,4]
coory = [1,1,1,1]
coorz = [1,1,1,1]
for i in range(4):
ax.scatter(coorx[i], coory[i], coorz[i], s = coorx[i]*40, alpha = 1, c = 'orange', zorder = 1)
ax.scatter(coorx[i], coory[i], coorz[i], s = 2, alpha = 1, c = 'white', zorder = 0)
plt.show()
As shown in the code, I have specified the orange points with higher zorder, but they are actually below the white ones.
I have searched the Internet and read the document, but they are of little help.