md_trajectory = nlread('ethane_md.nc')[-1]

angular_distribution = AngularDistribution(md_trajectory,
                                           cutoff_radius=[2.3*Angstrom, 1.2*Angstrom],
                                           triplet_selection=[Carbon, Carbon, Hydrogen])

# Get the histogram of the angle distribution and the associated angles.
histogram = angular_distribution.data()
angles    = angular_distribution.angles().inUnitsOf(Degrees)

# Plot the data using pylab.
import pylab

pylab.bar(angles, histogram, label='C-C-H angles')
pylab.xlabel('angle (degrees)')
pylab.ylabel('Histogram')
pylab.legend()

pylab.show()
