//  [python]
def get_group_figure(self):
        """Group average figure of skeleton

        - skeleton group average as ahline
        - skeleton subject average as ahline
        - tests between subject averages between groups
        """
        plt.style.use('default')

        self.g = sns.catplot(
                x='group',
                y='mean',
                hue='group',
                hue_order=self.df.group.unique(),
                data=self.df)

        if self.df['mean'].mean() < 0.005:
            self.g.ax.set_ylim(
                self.df['mean'].min() - (self.df['mean'].std()/3),
                self.df['mean'].max() - (self.df['mean'].std()/3)
                )

        self.g.fig.set_size_inches(8, 4)
        self.g.fig.set_dpi(150)
        self.g.ax.set_ylabel(f'{self.modality}')
        self.g.ax.set_xlabel('Group')
        self.g.ax.set_title(
            f'Average {self.modality} in skeleton for all subjects',
            fontweight='bold')

        # tick labels to have number of groups
        def get_ticklabels(tmp_df, group):
            row_count_for_group = len(tmp_df[tmp_df.group == group])
            return f'{group} ({row_count_for_group})'

        self.g.ax.set_xticklabels([get_ticklabels(self.df, x) for x in
                                   self.df.group.unique()])
        # group_list = corrpMap.group_labels
        # print(group_list)

        # average line
        line_width = 0.3
        gb = self.df.groupby('group')
        for num, group in enumerate(self.df.group.unique()):
            table = gb.get_group(group)
            average = table['mean'].mean()
            self.g.ax.plot([num-line_width, num+line_width],
                           [average, average])

        # Add stat information to the graph
        height = 0.9
        two_groups_perm = list(combinations(self.df.group.unique(), 2))

        # if two groups
        if len(self.df.group.unique()) == 2:
            height_step = 0.8 / len(two_groups_perm)
        else:
            height_step = 0.8 / (len(two_groups_perm) + 1)

        # two group comparisons
        # TODO: add ANCOVA
        for g1, g2 in two_groups_perm:
            gb = self.df.groupby('group')
            g1_means = gb.get_group(g1)['mean']
            g2_means = gb.get_group(g2)['mean']

            # t, p = ss.ttest_ind(g1_means, g2_means)
            t, p, dof = ttest(g1_means, g2_means)

            if p < 0.05:
                text = f'{g1} vs {g2}\nT ({int(dof)}) = {t:.2f}, P = {p:.2f}*'
            else:
                text = f'{g1} vs {g2}\nT ({int(dof)}) = {t:.2f}, P = {p:.2f}'

            self.g.ax.text(1, height, text,
                           transform=self.g.ax.transAxes)
            height -= height_step

        # ANCOVA if there are more than two groups
        if len(self.df.group.unique()) > 2:
            anova_df = anova(self.df, 'mean ~ group')
            f_val = anova_df.loc['group', 'F']
            dof = anova_df.loc['group', 'df']
            p = anova_df.loc['group', 'PR(>F)']
            if p < 0.05:
                text = f'ANOVA\nF ({int(dof)}) = '\
                       f'{f_val:.2f}, P = {p:.2f}*'
            else:
                text = f'ANOVA\nF ({int(dof)}) = '\
                       f'{f_val:.2f}, P = {p:.2f}'
            self.g.ax.text(1, height, text,
                           transform=self.g.ax.transAxes)