python how to put data on y-axis when plotting histogram

Posted by user3041107 on Stack Overflow See other posts from Stack Overflow or by user3041107
Published on 2014-06-11T15:21:20Z Indexed on 2014/06/11 15:24 UTC
Read the original article Hit count: 152

Filed under:
|

I don't quite understand how to control y - axis when using plt.hist plot in python. I read my .txt data file - it contains 10 columns with various data. If I want to plot distribution of strain on x axis I take column n.5. But what kind of value appears on y axis ??? Don't understand that. here is the code:

import numpy
import matplotlib.pyplot as plt
from pylab import *
from scipy.stats import norm
import sys

strain = []
infile = sys.argv[1]

for line in infile:
    ret = numpy.loadtxt(infile)
    strain += list(ret[:,5])     
fig = plt.figure()
plt.hist(strain, bins = 20)
plt.show()

Thanks for help!

© Stack Overflow or respective owner

Related posts about python

Related posts about histogram