Matplotlib scatter plot with unknown error

前端 未结 1 506
萌比男神i
萌比男神i 2021-01-03 17:55

I am attempting to create a scatter plot. I have a list of numbers from 0 - 17 as well as an array with 18 values. I can plot the data as a line plot but when I try to plot

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-03 18:20

    Check the scatter documentation. Third argument is for size of points and should be scalar or array_like. I assume 'r' is for color so do the following:

    plt.scatter(x, y, c='r')
    

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