how to plot 2 histograms side by side?

Viewed 30765

I have 2 dataframes. I want to plot a histogram based on a column 'rate' for each, side by side. How to do it?

I tried this:

import matplotlib.pyplot as plt
plt.subplot(1,2,1)

dflux.hist('rate' , bins=100) 
plt.subplot(1,2,2) 
dflux2.hist('rate' , bins=100) 
plt.tight_layout() 
plt.show() 

It did not have the desired effect. It showed two blank charts then one populated chart.

1 Answers
Related