There is simple solution, use matplotlib.pyplot.show() function after plotting.
this will display graph before executing next line of the code
%matplotlib inline
import matplotlib.pyplot as plt
i = 0
for data in manydata:
fig, ax = plt.subplots()
print "data number i =", i
ax.hist(data)
plt.show() # this will load image to console before executing next line of code
i = i + 1
this code will work as requested