我建议使用法线图。您可以通过获取双轴坐标
ax.twinx()。
import pandas as pdimport matplotlib.pyplot as pltdf = pd.Dataframe({"date": ["2018-01-01", "2018-01-02", "2018-01-03", "2018-01-04"], "column1": [555,525,532,585], "column2": [50,48,49,51]})ax = df.plot(x="date", y="column1", legend=False)ax2 = ax.twinx()df.plot(x="date", y="column2", ax=ax2, legend=False, color="r")ax.figure.legend()plt.show()


