TypeError: scatter() got multiple values for argument 's'

When I’m trying to change the size of the marker within the plot, it shows TypeError: scatter() got multiple values for argument ‘s’. Can anybody help me to figure out the problem? Thank you

fig_3d = plt.figure()
fig_3d.add_subplot(1,1,1, projection='3d')
constellation3d = plt.scatter(x,y,z, c = 'red', marker = '*', s = 8)
plt.show()

Hi,
The ‘s’ argument needs to be an array the same size as x and y - i.e. you’re setting a value for each item.
e.g.
x = [1, 2, 3, 4, 5]
y = [1, 2, 3, 4, 5]
would need something like,
s = [1, 2, 3, 4, 5]
would have points growing in size.

If you want them all the same you could use list comprehension, e.g.;
s = (8 for i in range(len(x)))
or
s = [8] * len(x)
would both give you,
s = [8, 8, 8, 8, 8]
using the above example.

Hope that helps