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

# Calculate the mass density profile along the A-vector of the cell.
density_profile = DensityProfile(md_trajectory,
                                 direction_index=0)

# Get the mass density in gram/ccm and the positions of the bin centers.
mass_density = density_profile.data().inUnitsOf(kiloGram/Meter**3)/1000.0
bin_centers  = density_profile.zValues().inUnitsOf(Angstrom)

# Plot the data using pylab.
import pylab

pylab.plot(bin_centers, mass_density,
           label='Mass density of alumina along A-vector')
pylab.xlabel('a (Angstrom)')
pylab.ylabel('d(a) (g/cm**3)')
pylab.legend()

pylab.show()
