Tag Archives: Line chart

‘c’ argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapp

When Python draws a line chart, using scatter, the use of parameter C = ” will cause warning:

ax.scatter(x_value,y_value,c=(0,0.2,0),s=10)

‘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.
It may be a problem with the version of matplotlib, higher versions no longer report a warning.
You can change the original statement to the following one.

ax.scatter(x_value,y_value,color=(0,0.2,0),s=10)

Or let the log display only errors of error level:

from matplotlib.axes._axes import _log as matplotlib_axes_logger
matplotlib_axes_logger.setLevel('ERROR')

Hope to help you through sharing, thank you.