I have two different dataframes with 19 variables each and I'm plotting a multiple plot with the histograms of each variable like this:
fig, ax = plt.subplots(figsize=(19,10), dpi=50)
dataframe1.hist(ax=ax, layout=(3,7), alpha=0.5)
fig, ax = plt.subplots(figsize=(19,10), dpi=50)
dataframe2.hist(ax=ax, layout=(3,7), alpha=0.5)
This produce two images with 19 histograms inside. What I want to try is to plot only one image with the shared histograms in the same subplot.
I tried this:
fig, ax = plt.subplots(figsize=(19,10), dpi=50)
dataframe1.hist(ax=ax, layout=(3,7), alpha=0.5, label='x')
dataframe2.hist(ax=ax, layout=(3,7), alpha=0.5, label='y', color='red')
But its only painting the last one. This is a similar example: Plot two histograms at the same time with matplotlib but how could I apply it two my 19 subplots?
Any ideas will be welcomed, thanks in advance!
P.S: I'm currently using Jupyter Notebooks with the %matplotlib notebook option