matplotlib scatter fails with error: 'c' argument has n elements, which is not acceptable for use with 'x' with size n, 'y' with size n

前端 未结 1 749
暖寄归人
暖寄归人 2021-01-04 05:54

I am trying to create a scatter plot using matplotlib where each point has a specific color value.

I scale the values and then apply alpha blending between a \'left\'

相关标签:
1条回答
  • 2021-01-04 06:25

    Convert colors to a float array with 0 <= colors <= 1 and it should work fine.

    sc.scatter(np.arange(len(values)), values, c = colors/255)

    0 讨论(0)
提交回复
热议问题