How to plot an histogram from a dictionary data? This is my data which is recorded in a dictionary. A sample of my dictionary looks like this: (id-s:{id-des:value})

{'1': {'1': 2.5039}, '2': {'2': 8.993242, '1': 8.972473}, '7': {'5': 6.4600, '7': 9.16026}, '3': {'5': 6.46004, '3': 8.8472, '6': 8.8266, '1': 8.806035}, '5': {'5': 8.70111}, '6': {'6': 8.8889}, '4': {'4': 9.55662}}


Firstly,I want to plot them in histograms. Every figure presents values of an  id-s. Every bar presents values (2.5039 is the value in the first example).

I have tried with this code.

plt.subplots(len(param_dict), 1, sharex=True)
    plt.subplots_adjust(hspace=0.8)
    for key, src in param_dict.items():
        plt.title('Source : {}'.format(key), fontsize=9)
        print(key)
        for attribute, value in src.items():
            print('{} : {}'.format(attribute, value))
            plt.hist(value, bins=20, alpha=0.5, label='my label')


But it takes only the last data.

Secondly, I want to plot all of them in one histogram, all values whatever their id-s.
you can try this way:

dictonary = {'1': {'1': 2.5039}, '2': {'2': 8.993242, '1': 8.972473}, '7': {'5': 6.4600, '7': 9.16026}, '3': {'5': 6.46004, '3': 8.8472, '6': 8.8266, '1': 8.806035}, '5': {'5': 8.70111}, '6': {'6': 8.8889}, '4': {'4': 9.55662}}
new_dictonary = {str((k,k1)):v1 for k, v in dictonary.items() for k1,v1 in v.items()}
plt.figure(figsize=(15,5))
plt.bar(new_dictonary.keys(), new_dictonary.values(), width=.5, color='g')