在散点图上用颜色绘制特定点

我有这2个清单:

list1 = ['2020-05-11 13:17:21', '2020-05-11 13:17:31', '2020-05-11 13:17:41',
 '2020-05-11 13:17:51', '2020-05-11 13:18:01', '2020-05-11 13:18:21',
 '2020-05-11 13:18:31', '2020-05-11 13:18:51', '2020-05-11 13:19:11',
 '2020-05-11 13:19:31', '2020-05-11 13:19:41', '2020-05-11 13:19:51',
 '2020-05-11 13:20:03', '2020-05-11 13:20:11', '2020-05-11 13:20:22',
 '2020-05-11 13:20:31', '2020-05-11 13:20:41', '2020-05-11 13:20:51',
 '2020-05-11 13:21:01', '2020-05-11 13:21:11', '2020-05-11 13:21:21',
 '2020-05-11 13:21:31', '2020-05-11 13:21:41', '2020-05-11 13:21:51',
 '2020-05-11 13:22:01', '2020-05-11 13:22:21', '2020-05-11 13:22:41',
 '2020-05-11 13:22:51', '2020-05-11 13:23:11', '2020-05-11 13:23:21',
 '2020-05-11 13:23:32', '2020-05-11 13:23:41', '2020-05-11 13:23:51',
 '2020-05-11 13:24:01', '2020-05-11 13:24:11', '2020-05-11 13:24:21',
 '2020-05-11 13:24:31', '2020-05-11 13:24:41', '2020-05-11 13:24:51']

list2 = [None, None, None, None, None, None, None, None, None, '-74', None, '-72', None, None, None, None, None, None, None, None, None, None, None, None, None, '-69', None, None, '-70', None, None, None, None, None, None, None, None, None, None]

我想绘制一个散点图(x = list1 y = list2)女巫仅显示不是None(在list2上)并且具有不同颜色的值。

有什么建议么?

评论
  • fomnis
    fomnis 回复

    也许您可以像这样在元组列表中获取每个点的坐标:

    to_plot = [(list1[i], list2[i]) for i in range(len(list1)) if list2[i] is not None]