#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt ###### input section ###### n = 72 # number of intervals step = 360.0/n # interval step ############ dist = np.zeros(n,dtype=np.int) # allocate the distribution array a = np.loadtxt('fort.11') # load the file and store the values in a new ndarray b = a[:,1].copy() # get the second column of a and store it in a new array dist, x = np.histogram(b,72,(0.,360.)) plt.plot(x[:-1],dist)