Constellations An off-platform project (Scatter Chart Not Showing)

%matplotlib inline
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

x = [-0.41, 0.57, 0.07, 0.00, -0.29, -0.32,-0.50,-0.23, -0.23]
y = [4.12, 7.71, 2.36, 9.10, 13.35, 8.13, 7.19, 13.25,13.43]
z = [2.06, 0.84, 1.56, 2.07, 2.36, 1.72, 0.66, 1.25,1.38]

fig_dogstar = plt.figure()
fig_dogstar.add_subplot(1,1,1, projection = "3d")
plt.scatter(x2, y2, z2, color = "purple", marker="o", linewidth=2)
plt.title("3D Leo")

fig_leo2d = plt.figure()
plt.scatter(x2, y2)
plt.title("2D Leo")

Hi peers, please help to review my code as written above.
I know that for interactive figure, we should not use %matplotlib inline for this project. However, if i used %matplotlib notebook, both the figures ( 2D and 3D) are not showing in jupyter notebook.
I have search online for the problem and they are many others having the same issue.
I have tried all the possible matter i have learned through Google but it looks like not worked for me.

anybody could solve my problem of not showing figure in jupyter with %matplotlib notebook ?

You need to use the z parameter for your z axis on your 3-d plot. Hint: ax_3d


1 Like

noted. thanks for your kind feedback. But my issue of figure not showing up in jupyter noteook if using %matplotlib notebook hasn’t solved yet.

There’s an error somewhere. What is the above referring to? x2, y2, z2 are not defined.

You will also need to import %matplotlib notebook (from the instructions)

1 Like