Orion-Constellation Project - Seeking Peer Review (from Visualize Data with Python)

Hey everyone!

I just finished the Off-Platform “Orion-Consetllation”. You can look up the Jupyter Notebook output and code on my Github:

In the last cell (4. Create a 3D Visualization) the instructions tell me to create another variable called “constellation3d”.
After seeing the solution of another user “kpat”. I went back and wanted to at least label my axis. I quickly realized that “plt.zlabel” does not work. When I looked up kpat’s solution again I saw, that he used “.set_zlabel” to set the z-axis label. I figured, that this is probably why the variable needs to be created and it did work.

My questions are:

  1. What is the variable “constellation3d” really needed for?
  2. Why does “plt.zlabel” not work?
  3. What difference is there between plt.xlabel and .set_xlabel?
  4. Why do all points appear to be the same hight, altough we have distinct z-values?

Also feel free to give me any tips on how to post on this forum. Is the github link sufficient, or should I include a codebyte the next time around?

Looking forward on your feedback! Cheers :slight_smile:

1 Like

Congrats on finishing the project. The GH link is sufficient so people can see your notebook.

Some thoughts:

  • You could add some more style parameters to the 2D plot.
    Like, change the background color and the markers used in the scatterplot. See the docs.

  • You need to use the scatter method for the 3D axis.
    Something like this:

fig3d = plt.figure()
ax3D = fig3d.add_subplot(1,1,1, projection="3d")
#ax3D.set_facecolor('black') #this sets the background to black
#ax3D.grid(False) #this gets rid of the grid
ax3D.scatter(x,y,z, c='silver', marker = '*', s= 100) #you can change the color and marker and size.

See:
Matplotlib docs

And here.

And the discussion here on the forums.

1 Like