Second y-axis time series seaborn

后端 未结 2 630
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 01:50

Using the data frame

df = pd.DataFrame({
    \"date\" : [\"2018-01-01\", \"2018-01-02\", \"2018-01-03\", \"2018-01-04\"],
    \"column1\" : [555,525,532,585]         


        
2条回答
  •  无人及你
    2020-12-29 02:47

    As seaborn is built on the top of matplotlib, you can use its power:

    import matplotlib.pyplot as plt
    sns.lineplot(data=df.column1, color="g")
    ax2 = plt.twinx()
    sns.lineplot(data=df.column2, color="b", ax=ax2)
    

提交回复
热议问题