Orion Constellation

Suggestions, tips, criticisms all welcome:)

2d plot 3d plot

1 Like

Is there a link to your code somewhere?

I’m not tech savy so i don’t know how to share the link from Jupyter. Here’s the code:

#for 2d graph
fig = plt.figure()
plt.scatter(x,y, cmap = “hsv”)
plt.plot(x,y)
plt.show()
plt.savefig(“2d plot”)

#for 3d graph
plt.figure()
cool = matplotlib.cm.cool
ax = plt.axes(projection = ‘3d’)
ax.plot3D(x,y,z)
ax.scatter3D(x,y,z, s=50, cmap = cool)
plt.title(“Orion Constellation”)
plt.xlabel(“x-coordinates”)
plt.ylabel(“y-coordinates”)
ax.set_zlabel(“z-coordinates”)
plt.show()
plt.savefig(“3d plot”)

Apologies, I thought this project was done in the LE where there is a link to upload your code to GitHub.
If you have a GitHub account, you can upload your .ipynb file as a new repository and share the GitHub link there.

to format your code here, select the “</>” button above.

You can also change the background color and the marker style. It’s in the documentation:

https://matplotlib.org/api/markers_api.html#module-matplotlib.markers

to change the background color of the plot,
ax.set_facecolor('insert color here')

https://stackoverflow.com/questions/14088687/how-to-change-plot-background-color

If you’re familiar with the comic xkcd, there’s a whole list of colors here:
https://xkcd.com/color/rgb/

I didn’t have those lines in mine and now I’m re-thinking what I did. :joy:

1 Like

It might be a personal thing but I’m not sure about having the lines plotted behind the scatter. It kind of confuses the data points you have.

A good effort. I don’t know much about constellations, but this is cool.