📜  python 绘制字典 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:21.929000             🧑  作者: Mango

代码示例1
# credit to the Stack Overflow user in the source link

import matplotlib.pylab as plt

lists = sorted(d.items()) # sorted by key, return a list of tuples

x, y = zip(*lists) # unpack a list of pairs into two tuples

plt.plot(x, y)
plt.show()