Skip to content

Optionally color paired plots #207

Closed

Description

@siemdejong

Is your feature request related to a problem? Please describe.

groups_baseline = dabest.load(df, idx=("1", "2", "3", "4", "5"), paired="baseline", idx="id")

doesn't show a colored plot

Describe the solution you'd like
Have colors when using paired=..., just like there is if there is no paired=....
The structure of the plot can stay the same.

Describe alternatives you've considered
Do

groups_no_baseline = dabest.load(df, idx=("1", "2", "3", "4", "5"))

but this removes the "pairing line" between the datapoints and the mean difference should be paired.

Additional context

Image
(labels censored)

This issue results from the following experimental setup:

  1. divide data in 10 groups (3 shown above)
  2. for every group, do 5 experiments
    So there is pairing via the 10 groups.

Activity

  1. JAnns98 commented on Apr 30, 2025

    @JAnns98
    Collaborator

    Paired plots are currently displayed as a slopegraph - paired lines without markers. There would therefore be no aesthetic logic for color coding each group. Is your suggestion that we should include markers for each data point in each group (and color these) as well as including the slopegraph (black lines)?

  2. siemdejong commented on May 1, 2025

    @siemdejong
    ContributorAuthor

    The slopegraph without markers is fine.

    Let me try to explain better. My suggestion would be to have an argument to color the bars and the paired mean difference distribution like done in the plot on the right.

    I think, that

    halfviolin(v, fill_color="grey", alpha=contrast_alpha, half=half)

    and
    def halfviolin(v, half="right", fill_color="k", alpha=1, line_color="k", line_width=0):

    b.set_color(fill_color)

    make the colors gray/black by default and does not allow for each bar to have a distinct color.

    Something like what is done here

    bootstraps_color_by_group : bool

    may already be enough.

  3. JAnns98 commented on May 2, 2025

    @JAnns98
    Collaborator

    Ooh i see, you would like to be able to have the colored groups for the bars and the halfviolins. I will look into the cleanest way to implement this if we do decide to - will get back to you :)

  4. siemdejong commented on May 2, 2025

    @siemdejong
    ContributorAuthor

    A suggestion: it would be great if it was compatible with plt.style.use(...) so that users can use any color cycle.

  5. siemdejong commented on Aug 6, 2025

    @siemdejong
    ContributorAuthor

    if we do decide to

    Have you decided if this is something that could be added?

  6. JAnns98 commented on Aug 14, 2025

    @JAnns98
    Collaborator

    Hi! Apologies for the long delay. I am working on it at the moment. We are also doing some modifications to the default plotting format of the slopegraph plots. So far I have added this functionality if the user specifies a custom_palette in the plotting function - ie., if the user doesn't specify a custom_palette, it will remain black/grey

    Image
  7. JAnns98 commented on Aug 26, 2025

    @JAnns98
    Collaborator

    This feature has now been pushed to the dev (vnbdev) branch

  8. PaulBallot commented on Jan 20, 2026

    @PaulBallot

    Hi! Apologies for the long delay. I am working on it at the moment. We are also doing some modifications to the default plotting format of the slopegraph plots. So far I have added this functionality if the user specifies a custom_palette in the plotting function - ie., if the user doesn't specify a custom_palette, it will remain black/grey

    Image

    I have a question in regard to this: I am trying to have both the raw slopes and the mean difference distributions coloured by group. However, changing the color_col parameter affects only the slopes, while creating a dictionary for the custom_palette only influences the mean difference distributions. Is there any way to apply the same colour to both parts?

  9. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions