//  [python]
def __individual_tasks_plot(self, df, op_dict, pdf):
        """ Plot results for each task separately.

        It plots results for all metrics for each task separately.
        Each task will have its own plot and page in the pdf report file.

        Args:
            df (pandas.DataFrame): results data frame
            pdf (matplotlib.backend.pdf): matplotlib object to write plots into
                    a pdf file.
        """
        def __kpmeier(x):
            x_uniq = np.unique(x)
            x0 = list([x_uniq[0]])
            x1 = list([1])
            for t in x_uniq[:-1]:
                s_hat_ti = list()
                for ti in x_uniq:
                    if ti < t:
                        d_i = (x == ti).sum()
                        n_i = (x > ti).sum()
                        s_hat_ti.append((1 - d_i/float(n_i)))
                x0.extend((t, t))
                x1.extend((x1[-1], np.array(s_hat_ti).prod()))
            x0.extend((x0[-1], x_uniq[-1], ))
            x1.extend((0, 0))
            return x0, x1

        def __individual_metric_kaplan_meier(df, op_task, pdf, title):
            df.is_copy = None
            # fig, ax = plt.subplots(figsize=(10, 5), ncols=2, nrows=1)
            fig = plt.figure()
            fig.subplots_adjust(hspace=0.4, wspace=0.4)
            ax1 = fig.add_subplot(2, 1, 1)
            plt.suptitle(title, fontsize=16)

            # Draw a nested barplot to show Class. ACC for each methods
            g = sns.factorplot(x="Metric", y="Value", hue="Methods",
                               data=df, size=6, kind="bar",
                               palette="muted", legend=False, ax=ax1)
            g.despine(left=True)
            g.set_ylabels('Value')
            plt.legend(loc='upper right')
            if not title:
                nb_tasks = len(df['Task'].unique())
                g.fig.suptitle('Average over all ({}) tasks'.format(nb_tasks))
            else:
                g.fig.suptitle(title)

            # kaplan meier
            if df['Metric'].iloc[0] in ('rmse', 'nmse'):
                # colors = ['azure', 'green', 'sienna', 'orchid', 'darkblue']
                colors = ["windows blue", "amber", "greyish", "faded green", "dusty purple"]
                leg_list = list()
                ax2 = fig.add_subplot(2, 1, 2)
                for i, k in enumerate(op_task.keys()):
                    # plot observed curve
                    if i == 0:
                        y0, y1 = __kpmeier(op_task[k]['obs'])
                        ax2.plot(y0, y1, color='xkcd:black')
                        leg_list.append('Observed')

                    # plot predicted value for all methods
                    p0, p1 = __kpmeier(np.squeeze(op_task[k]['pred']))
                    ax2.plot(p0, p1, color='xkcd:%s' % colors[i])
                    leg_list.append(k[0:10])
                ax2.set_xlabel('Time')
                ax2.set_ylabel('Survival Probability (%)')
                ax2.legend(leg_list)
            pdf.savefig(fig)

        df.is_copy = None
        tasks = df['Task'].unique()
        runs = op_dict.keys()
        for task in tasks:
            op_dict_task = dict()
            for met in op_dict.keys():
                print(op_dict[met].keys())
                op_dict_task[met] = op_dict[met][task]
            __individual_metric_kaplan_meier(df[df['Task'] == task],
                                             op_dict_task, pdf, task)