[英]How to create a matplotlib graph with a secondary y-axis?
I would like to create a line graph using matplotlib, where COMP
and MKR
are on one axis, and LEND
, KNC
are on a secondary y-axis.我想使用 matplotlib 创建一个折线图,其中COMP
和MKR
在一个轴上, LEND
、 KNC
在第二个 y 轴上。 The X-axis should be the date column. X 轴应该是日期列。 I only want dates from 2020-07-18
to 2020-07-20
.我只想要从2020-07-18
到2020-07-20
的日期。 The below output is a pandas dataframe.下面的 output 是 pandas dataframe。
How can I do that?我怎样才能做到这一点? Thanks!!谢谢!!
COMP LINK LEND KNC MKR
date
2020-07-16 154.84 8.350 0.2766 1.571 443.10
2020-07-17 167.20 8.261 0.2883 1.636 449.49
2020-07-18 163.72 7.971 0.3110 1.826 454.50
2020-07-19 163.40 8.083 0.3534 1.689 465.80
2020-07-20 166.00 7.932 0.3519 1.710 461.10
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.