See the code below for the answer , and how subplot can be used :
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure(figsize=(12,10))
ax = fig.add_subplot(111, projection ='3d') #top left
def randrange(n, vmin, vmax):
'''
Helper function to make an array of random numbers having shape (n, )
with each number distributed Uniform(vmin, vmax).
'''
return (vmax - vmin)*np.random.rand(n) + vmin
n =1024
xp1A = np.ones(1024) * randrange(n, 23, 32)
xp1B = np.ones(1024) *randrange(n, 11, 32)
xp1C = np.ones(1024) * randrange(n, 25, 27)
yp1A = np.ones(1024) *randrange(n, 9, 16)
yp1B = np.ones(1024) * randrange(n, 1, 11)
yp1C = np.ones(1024) * randrange(n, 5, 18)
zp1 = np.empty(1024)
for i in range(1024):
zp1[i] = 1
xp2A = np.ones(1024) * randrange(n, 6, 44)
xp2B = np.ones(1024) * randrange(n, 7, 63)
xp2C = np.ones(1024) * randrange(n, 2, 22)
yp2A = np.ones(1024) * randrange(n, 11, 69)
yp2B = np.ones(1024) * randrange(n, 41, 77)
yp2C = np.ones(1024) * randrange(n, 63, 78)
zp2 = np.empty(1024)
for i in range(1024):
zp2[i] = 2
#p1A = ax.scatter(xp1A , yp1A, zp1 c='red')
ax.set_xlabel('Snapshot')
ax.set_ylabel('Value')
ax.set_zlabel('Dataset')
ax.legend()
plt.scatter(xp1A , yp1A, zp1, c='red')
plt.scatter(xp1B , yp1B, zp1, c='blue')
plt.scatter(xp1C , yp1C, zp1, c='green')
plt.scatter(xp2A , yp2A, zp2, c='yellow')
plt.scatter(xp2B , yp2B, zp2, c='black')
plt.scatter(xp2C , yp2C, zp2, c='brown')
#p1A.plot()
#plt.plot() #I am trying to do this
#lt.plot(p1A,p1B,p1C,p2A,p2B,p2C) #Or this, but none works
plt.show()