代码之家  ›  专栏  ›  技术社区  ›  Unknown

python中的多色时间序列散点图

  •  0
  • Unknown  · 技术社区  · 6 年前

    我是巨蟒的新手。我有时间序列数据,我需要一个散点图。 我基本上希望正常和异常的标签有不同的颜色。见以下数据和绘图图像:

    实际数据

    enter image description here

    预期的数据重排

    enter image description here


    预期绘图

    enter image description here


    我将非常感谢这方面的任何线索! 事先谢谢!

    1 回复  |  直到 6 年前
        1
  •  1
  •   Yon P    6 年前

    你可以用 matplotlib.pyplot scatter

    import matplotlib.pyplot as plt
    
    plt.scatter('#normal_TimestampColumn', '#normalColumn', facecolors='b')
    plt.scatter('#abnormal_timestampColumn', '#abnormalColumn', facecolors='orange')