Orion Constellation project

Here is my constellation project - I had a lot of trouble with making matplotlib work in Jupyter Lab - looking through the forum it seems like no-one else had this issue? (Javascript Error: Can’t find variable: IPython)

Congrats on finishing up, you may not be able to tell until you get the interactive matplotlib sorted but your second plot is not currently in 3D. Double check the instructions-

"Add your subplot with .add_subplot() as the single subplot 1,1,1 and specify your projection as 3d :
`fig_3d.add_subplot(1,1,1,projection=“3d”)

Regarding the plots-
I’m not sure many users would make use of the full JupyterLab, I think most folks use just the notebook. I’m not knocking the lab as an IDE but the instructions may differ a bit if you use it.

Something like the following seems to suggest interactive matplotlib integration might not be the default-

Maybe have a search around for the same terms if that doesn’t cover your issue.

thank you - I didnt realise the Lab and the Notebook were so different!
I have hopefully changed that now (https://github.com/ctaylo-16/codecademy_data_science.git )

1 Like

Grand so, yes I can see the figures now :+1:. I think those instructions are a bit flaky now I’ve re-read them. Creating the 3D axis is one thing but you must also use the scatter method of that 3D axis object, the standard scatter is still a function that accepts only x/y positions, it cannot deal with z (if I remember correctly it treats a third positional argument as marker size).

So you’d want to adjust this to something like the following-

ax3d = fig_3d.add_subplot(1,1,1,projection='3d')
constallation3d = ax3d.scatter(x, y, z, color = 'black', marker = '*', alpha=0.7)

It’s a bit awkward for this one as the units are kooky but it’s good to get the in the habit of labelling your axes. Creating figures for yourself is one thing but if you showed a figure without labels to someone else there’s a very good chance they’ll have no idea what it is. Ideally your figure would be almost self-explanatory without ever reading the accompanying text (this is often difficult but making it as easy as possible is good :slightly_smiling_face:).

great- that was super helpful! it now looks 3d to me. I’ve labelled the axes with what I think are the right values and units. thanks for helping me improve this!

2 Likes