Re: Feedback on 2D & 3D Orion Constellation
Q1. #plt.Axes3D.scatter(x, y, z, s = 30, marker = ‘o’)
“Axes3D” does not seem to work, even though we imported:
Q2. How to make 3D look more appealing, eg, bigger dots,
Q3. How to label x, y, z, or legend.
Thank you for taking the time writing feedback. cheers, judy
From the standard
matplotlib.pyplot.scatter() function you will only get 2D plotting as there’s no
z parameter. You’d want to be using the scatter method of the 3D axis itself, e.g.
fig_3d = plt.figure()
ax_3d = plt.subplot(1, 1, 1, projection="3d")
orion_3d_scatter = ax_3d.scatter(x, y, z ...
You can check the docs for details which I think would also cover your second query as it covers the parameters you’d need to supply in order to alter size, shape and colour of the scatter points-
You already appear to be using labelling for the axes, if you need a legend as well then have a look at- https://matplotlib.org/api/_as_gen/matplotlib.pyplot.legend.html#matplotlib.pyplot.legend