Warning when using scatter in 3d

I am getting this : " ‘c’ argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with ‘x’ & ‘y’. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. " . Yes I am using RGB as color in ax.scatter(), but no warning at all when I ax.plot() is called.

Code

Rgds.

c in scatter can take in a list of colors (one for every data point), so you’re discouraged from passing in an RGB tuple since it’s indistinguishable from a list of colors. https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.scatter.html?highlight=scatter#matplotlib-axes-axes-scatter

The color argument in .plot can only ever be one color.

Yes, but my point is that the code works anyway.

1 Like

I understand that a very good reason is behind this, but from my hobby-coding point of view It is strange.

Thank you.