Orion Constellation Project Pointers & Common Issues You May Encounter

You’re probably asking yourself, ‘what prompted this post?’ :thinking:

These are just a few things that have come up over the years in reviews of this project.

There is a really helpful thread that is linked to quite often, it is here.
Note, the Matplotlib documentation linked in that thread is outdated. You can find the updated docs here.

Essentially, one major thing that I think people overlook when doing this project for whatever reason (maybe it’s not clear in the directions) is when doing the 3-D scatterplot:

3D Scatterplots

  • You NEED to use the scatterplot method for the 3-D axis. By that, I mean something like this:
fig3d = plt.figure()
ax3D = fig3d.add_subplot(1,1,1, projection="3d")
ax3D.scatter(x,y,z, c='gold', marker = '*', s= 100) #you can change the color and marker and size of the stars.

You can even remove the grid for the 3D plot by using this (b/c who wants to look at a grid behind a constellation?):

ax3D.grid(False)

And some potential ideas for the 2-D plot:

2-D scatterplots

  • Don’t be afraid of looking at other methods & parameters for this plot. Things like type of marker, color, size, background color, etc. It’s all in the docs. Don’t be afraid to mix it up. Don’t have a boring plot! :slight_smile:

ex:

plt.scatter(x,y, color = 'gold', marker = '*', s=70)

You can also change the facecolor/background of the plot by using this:
ax.set_facecolor('navy')

The docs:
https://matplotlib.org/stable/api/colors_api.html

Further-- I think this is pretty neat-- you can even use xkcd colors for the ax.set_facecolor() method. See here.

Ex:

fig2d = plt.figure()
ax = fig2d.add_subplot(1,1,1)
ax.set_facecolor('xkcd:marine')
ax.set_xlabel('x coordinates')
ax.set_ylabel('y coordinates')
plt.scatter(x,y, color = 'gold', marker = '*', s=70)
plt.title('2D Constellation: Orion')
plt.show()

Remember, when doing a project like this, it’s okay to ‘color outside the lines’. Make the project your own. I think that’s how we learn. :nerd_face:

Happy coding! :woman_technologist: :night_with_stars: :stars: :bridge_at_night:

1 Like