如何在python中绘制元组列表?

tus*_*ala 3 python tuples matplotlib

如何使用matplotlib模块在python中绘制元组列表?元组列表

[(155, 16.84749748246271), (158, 13.618280538390644), (38, 13.103707537648402), (53, 10.157244261797375), (156, 6.779897254994966), (119, 6.27045632052444), (159, 4.3453112093858275), (161, 4.028984416275573), (32, 4.026263736663865), (118, 3.437058351914913)]
Run Code Online (Sandbox Code Playgroud)

在元组中,第一个值代表反应数,第二个值代表灵敏度。

U10*_*ard 5

怎么样:

import matplotlib.pyplot as plt
plt.plot([(155, 16.84749748246271), (158, 13.618280538390644), (38, 13.103707537648402), (53, 10.157244261797375), (156, 6.779897254994966), (119, 6.27045632052444), (159, 4.3453112093858275), (161, 4.028984416275573), (32, 4.026263736663865), (118, 3.437058351914913)])
plt.show()
Run Code Online (Sandbox Code Playgroud)