:param method_labels: list of legend labels for the methods, i.e. give
        'Radial Velocity' rather than 'RV'

        :return:

def plot(self, method_labels=None, exodata_credit=True):
        """
        :param method_labels: list of legend labels for the methods, i.e. give
        'Radial Velocity' rather than 'RV'

        :return:
        """

        if method_labels is None:
            method_labels = self.methods_to_plot

        plot_matrix, year_list, discovery_years = self.generate_data()

        fig = plt.figure()
        ax = fig.add_subplot(1, 1, 1)

        ind = np.arange(len(year_list))

        # output from seaborn.color_palette("Set1", n_colors=8)
        colors = [(0.89411765336990356, 0.10196078568696976, 0.10980392247438431),
                  (0.21602460800432691, 0.49487120380588606, 0.71987698697576341),
                  (0.30426760128900115, 0.68329106055054012, 0.29293349969620797),
                  (0.60083047361934883, 0.30814303335021526, 0.63169552298153153),
                  (1.0, 0.50591311045721465, 0.0031372549487095253),
                  (0.99315647868549117, 0.9870049982678657, 0.19915417450315812),
                  (0.65845446095747107, 0.34122261685483596, 0.1707958535236471),
                  (0.95850826852461868, 0.50846600392285513, 0.74492888871361229)]

        width = 0.9
        bottom = np.zeros_like(year_list)
        for i, method in enumerate(self.methods_to_plot):
            bar_data = [plot_matrix[year][method] for year in year_list]
            plt.bar(ind, bar_data, width, color=colors[i], bottom=bottom, label=method_labels[i], linewidth=0)

            bottom += np.array(bar_data) # plot the next bar stacked

        plt.ylabel('Number of planets', fontsize=14)
        plt.xlabel('Year', fontsize=14)
        plt.xticks(ind+width/2., year_list, rotation=70, fontsize=13)
        plt.xlim(0, ind[-1]+1)
        plt.legend(loc=2, fontsize=13)

        if exodata_credit is True:
            ax.text(2, 420, 'Generated by ExoData on {}'.format(time.strftime("%d/%m/%Y")), fontsize=11)

        for i, year in enumerate(year_list):
            try:
                total_planets = discovery_years[year]
            except KeyError:  # year with no planets discovered
                continue  # Dont label
            y_pos = bottom[i]+10
            x_pos = i

            ax.text(x_pos, y_pos, '{}'.format(total_planets), fontsize=9)

        plt.grid(b=True, which='both', color='0.9', linestyle='-')

        return fig