As it was said dictionaries are unordered.
To keep your code, there is a way to display your plot sorted.
Sorting dictionary keys.
Look
if __name__ == "__main__":
year_d = {"5": 'b', "3": 'c', "4": 'z', "1":'a'}
print year_d.keys()
keys = map(int, year_d.keys())
keys = map(keys.sort(), keys)
print keys
original:
['1', '3', '5', '4']
sorted:
[1, 3, 4, 5]