I have a problem going on. I tried to plot two dictionaries (with the same (number of) keys, but different values) in one graph. The idea is to make a line graph containing two lines; both dictionaries. The x-axis will be the dictionary keys, where the y-axis will be the values in both dicts. I managed to plot using
plt.plot(range(len(dict1)), dict1.values())
plt.plot(range(len(dict2)), dict2.values())
When i run the plot, it shows indeed two lines. But the x axis ticks (the keys from the dict (one or the other) are not sorted, while they were when I printed the dictionaries. I know this is due to the fact that getting the dict.values() creates an unsorted list. But when I change the plot data to this instead:
plt.plot(range(len(dict1)), sorted(dict1.values())), the values shown in the plot won't change with it. The xticks are finally ordered, but the line graph does not match the right value anymore. How can I bypass this?
dicts in the morning, I plot twodict's at night [...] and at every 10,000 points, I plot twodicts.