绘制大小不同的列表

时间:2019-10-06 16:57:01

标签: python pandas list matplotlib seaborn

给出一个列表列表,我试图以不同的颜色绘制每一行,但是会出错:

  

ValueError:x和y的大小必须相同

lists = 

    0     [[44.9597, 7.7825], [44.9646, 7.7816], [45.1206, 7.7115]]
    1     [[45.0021, 7.6733], [45.003, 7.6678]]
    2     [[45.0746, 7.5985], [45.0735, 7.5956],[44.9706, 7.704],[45.0811, 7.5511]
    3     [[45.1205, 7.7116]] 

因此,每行中[]中的第一个数字是y,第二个数字是x

我尝试过matplotlibseaborn

1 个答案:

答案 0 :(得分:2)

您可以将matplotlib的{​​{1}}函数与scatter(x,y)一起使用:

numpy