Orion Constellation project

Hello folks, I just rounded up my Orion constellation project and decided to share for your advice, pls is they any way to do it better, I mean write shorter code lol.

2D visualization of Orion:
fig = plt.figure(figsize=(7, 4))
ax = fig.add_subplot(111)
ax.scatter(x, y, c=‘w’)
ax.set_title(‘Orion constellation 2D View’)
ax.set_facecolor(‘k’)
plt.show()
plt.savefig(‘2d.png’)

3D Visualization of Orion
fig_3d = plt.figure(figsize=(7, 4))
ax = fig_3d.add_subplot(111, projection=‘3d’)
constellation3d = ax.scatter(x, y, z)
ax.set_title(‘Orion constellation 3D View’)
plt.show()
plt.savefig(‘3d.png’)

Tried putting the 3D visualization picture but it says new users can’t post more than 1 picture, sorry about that, please is they anyway I can go about it?

Thanks for reading!

Hello, @bizdons, welcome to the forum! Your code seems very concise, although I haven’t dealt with this code much. To post the 3D image, you can just reply to the topic, and post that image there. Your dot plot is nice and easy to read, as well!

1 Like

Here is the 3D Visualization of Orion that I wasn’t able to post with the original, Thanks @codeneutrino for helping me find a way out :grinning:.

1 Like

I like the 3D model, although is there any way you can label that axis?

Voila!
fig_3d = plt.figure(figsize=(7, 4))
ax = fig_3d.add_subplot(111, projection=‘3d’)
constellation3d = ax.scatter(x, y, z)
ax.set_title(‘Orion constellation 3D View’)
ax.set_xlabel(‘x-axis’)
ax.set_ylabel(‘y-axis’)
ax.set_zlabel(‘z-axis’)
plt.show()
plt.savefig(‘3d.png’)

Nice! Can you label them with labels that refer to what they represent?

After much research I came up with this, Hope it helps.

1 Like

Much better! That looks very good now!

1 Like

Thanks for bringing out the best from me! :smiley:

1 Like