class FractionalAbundance(object):
    def __init__(self, y, temperature, density):
        self.y = y
        self.temperature = temperature
        self.density = density

    def plot_vs_temperature(self, **kwargs):
        from matplotlib.pyplot import gca
        ax = gca()

        ax.loglog(self.temperature, self.y.T, **kwargs)
        ax.set_xlabel('$T_\mathrm{e}\ [\mathrm{eV}]$')
        ax.set_ylim(0.05, 1.3)
        self._annotate_ionisation_stages(ax)

    def _annotate_ionisation_stages(self, ax):
        max_pos = self.y.argmax(axis=-1)
        for i in xrange(self.y.shape[0]):
            index = max_pos[i]
            xy = self.temperature[index], self.y[i, index]
            s = '$%d^+$' % (i,)
            ax.annotate(s, xy, ha='center')



@@ -1,8 +1,29 @@
+import numpy as np%0A%0A%0A
 class Fr
@@ -188,16 +188,272 @@
 ensity%0A%0A
+    def mean_charge(self):%0A        %22%22%22%0A        Compute the mean charge:%0A            %3CZ%3E = sum_k ( y_k * k )%0A        %22%22%22%0A%0A        k = np.arange(self.y.shape%5B0%5D)%0A        k = k%5B:,np.newaxis%5D%0A%0A        z_mean = np.sum(self.y * k, axis=0)%0A        return z_mean%0A%0A
     def 

Implement mean_charge().