python画折线图时,使用scatter,参数c=’'的使用会引起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.
可能是matplotlib的版本问题,高版本已经不会报warning。
可以将原先的语句改为如下语句:
ax.scatter(x_value,y_value,color=(0,0.2,0),s=10)
或者让日志只显示error级别的错误:
from matplotlib.axes._axes import _log as matplotlib_axes_logger
matplotlib_axes_logger.setLevel('ERROR')
参考文章:链接: link.
希望通过分享能帮助大家,谢谢。