I have a dictionary of dictionaries with the following structure:
{'ytrain_0': {'Neut': 0,'hard': 143,'hard linked': 1507,'soft': 112,'soft linked': 1238},
'ytrain_102000': {'Neut': 426,'hard': 519,'hard linked': 829,'soft': 467,'soft linked': 759},
'ytrain_105000': {'Neut': 406,'hard': 489,'hard linked': 826,'soft': 499,'soft linked': 780}}
This is just an example. My real dictionary has 78 dictionaries. Now what I want to do is that I want to make a histogram for each example (train_0,ytrain_102000,ytrain_105000)
. How can I do that in python? I haven't been able to figure that out.
Instead of creating 78 different graphs and adjusting it one image myself. I want to make 78 graphs in one image using python. I know we can do that in R using mfrow(). But I don't know how to do that in python? Can someone help me out with it?
I am using the following code to plot:
output = []
for a in dictionary_test.keys():
output.append(dictionary_test[a])
import pandas as pd
pd.DataFrame(output).hist()
ax = pd.DataFrame(output).plot.bar(rot=0)
axes = pd.DataFrame(output).plot.bar(rot=0, subplots=True)
axes[1].legend(loc=2)
I get the following graph:
How to make sure that heading of each subplot does not appear on the other graph?