How can I overlay two graphs in Seaborn?

后端 未结 4 1944
梦谈多话
梦谈多话 2020-11-27 17:59

How can I overlay two graphs in Seaborn? I have two columns in my data I would like to have them in the same graph. How can I do it preserving the labeling for both graphs.

4条回答
  •  佛祖请我去吃肉
    2020-11-27 18:19

    The simplest example would be:

    import matplotlib.pyplot as plt
    
    data1 = [1, 2, 3, 4, 5]
    
    data2 = [1, 1.1, 1.3, 4, 4.1]
    
    def plotter():
        plt.plot(data1)
        plt.plot(data2)
        plt.show()
    
    
    plotter()
    

提交回复
热议问题