我有数据存储在python词典中(对于每个国家都有值列表):
{' BE':[' 259.1587',' 252.2124',' 248.4519',' 247.5489& #39;,' 247.9576',' 250.0425',' 182.5851',' 180.1105',' 179.6083& #39;,' 178.5209',' 176.7081',' 174.8502'],' FR':[' 103.3834 ',' 101.1851',' 98.2804',' 95.9919',' 94.3940',' 92.9902 ',' 91.4351',' 90.3078',' 89.3786',' 88.5690',' 88.3090 ',' 88.8994'],' BG':[' 63.9277',' 69.9601',' 65.4384',' 64.1908',' 64.5276',' 67.7657',' 66.8916',' 67.0778',' 67.617',' 68.2783',' 65.4651',' 62.7898'],&#39 ; DK':[' 75.7358',' 75.2223',' 73.7547',' 71.2911',&#39 ; 67.4805',' 65.3390',' 62.9360',' 61.3575',' 58.4678',&#39 ; 57.7756',' 57.0328',':'],' HR': [&#;;;;;;;;;;;;;;;;;; ,' 94.4324',' 93.0424',' 96.3094',' 94.9562',' 94.6190' ,' 97.0368',' 104.6504'],' DE':[' 107.4606',' 107.4609&#39 ;,' 105.7275',' 106.5801',' 106.7862',' 107.0506',' 108.4679&#39 ;,' 110.0985',' 112.6987',' 114.7489',' 117.9135',' 120.6868&#39 ;],' HU':[' 98.5704',' 42.3163',' 40.8225',' 40.0413&# 39;,' 39.1802',' 39.3375',' 38.2867',' 33.5230',' 31.8583&# 39;,' 32.7758',' 32.9499',' 33.1136']}
我想在一个图中绘制关键值的所有数据,例如每个国家将有一行。有什么想法吗?
谢谢! 克拉拉
答案 0 :(得分:0)
除:
数据中的狡猾DK
外,如果您的词典为c
:
import pylab
for cc, vals in c.items():
pylab.plot([float(x) for x in vals], label=cc)
pylab.legend()
pylab.show()
请注意,假设您已安装matplotlib
/ pylab
。