Plotting histograms in Python using pandas
<p>I'm trying to create a histogram with two data sets overlying each other, however whenever I plot it using pandas.DataFrame.hist(), it creates two graphs:</p>

<p><img src="http://i.stack.imgur.com/ldlcs.png" alt=""></p>

<p>The code is simply:</p>

<pre><code>ratios.hist(bins = 100)
plt.show()
</code></pre>

<p>where ratios is just a DataFrame, 2 columns by about 7000 rows. Any idea on how to put the two graphs on the same axis?</p>

<p>Try <a href="http://pandas.pydata.org/pandas-docs/stable/visualization.html#histograms" rel="nofollow">plot.hist</a> instead:</p>

<pre><code>ratios = pd.DataFrame(np.random.normal((1, 2), size=(100, 2)))
ratios.hist(bins=10)
</code></pre>

<p>This generates:</p>

<p><a href="http://i.stack.imgur.com/fyop0.png" rel="nofollow"><img src="http://i.stack.imgur.com/fyop0.png" alt="enter image description here"></a></p>

<pre><code>ratios.plot.hist(alpha=0.5, bins=10)
</code></pre>

<p>This, on the other hand, puts them on the same graph:</p>

<p><a href="http://i.stack.imgur.com/e6ElX.png" rel="nofollow"><img src="http://i.stack.imgur.com/e6ElX.png" alt="enter image description here"></a></p>

python pandas histogram