我在其他地方也看到了这个问题,但是我没有使用熊猫找到它
我有这样的东西:
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(nrows=2, ncols=2)
lm = df_1_1.plot(x="pavg", y="fx", color="blue", ax=ax1, linewidth=0.85)
lm = df_1_2.plot(x="pavg", y="fx", color="blue", ax=ax1, ls="--",
linewidth=0.9)
lm = df_2_1.plot(x="pavg", y="fx",color="red", ax=ax1, linewidth=0.85)
lm = df_2_2.plot(x="pavg", y="fx",color="red", ax=ax1, ls="--",
linewidth=0.9)
lm = df_3_1.plot(x="pavg", y="fx", color="green", ax=ax1, linewidth=0.85)
lm = df_3_2.plot(x="pavg", y="fx", color="green", ax=ax1, ls="--",
linewidth=0.9)
plt.show()
我想要3个图例,而不是6个,
Legend 1: df_1: - 1 -- 2
Legend 2: df_2: - 1 -- 2
Legend 1: df_3: - 1 -- 2
如何修改代码以实现此目标?谢谢!