PyPlot 3d plotting

Why this code does not work without second line: p1=scatter3D(,0) ? This line is unnecessary for me. How to write it correctly to get one chart, not two ?

using PyPlot
p1=scatter3D([],0)
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
ax.scatter(rand(100),rand(100),rand(100),color="red")
ax.scatter(rand(100),rand(100),rand(100),color="yellow")
ax.scatter(rand(100),rand(100),rand(100),color="blue")

Second question: How to close p1 ?
Thx

See the PyPlot 3d Plotting manual: just call using3D() to ensure 3d plotting is initialized. (Calling an explicit 3d function like scatter3D initializes 3d plotting automatically, but you need to initialize explicitly if you are using 3d via a projection="3d" keyword).