如何生成随机颜色以传递到绘图函数的简单示例是什么?
我在循环中调用散点,希望每个情节都有不同的颜色。
for X,Y in data:
scatter(X, Y, c=??)
丙: a color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however.