Optionally color paired plots
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
(labels censored)
This issue results from the following experimental setup:
- divide data in 10 groups (3 shown above)
- for every group, do 5 experiments So there is pairing via the 10 groups.
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)?
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 https://github.com/ACCLAB/DABEST-python/blob/5d83bb12d6e58343881fe10869b7650f06b9c3c2/dabest/plot_tools.py#L1271 and https://github.com/ACCLAB/DABEST-python/blob/5d83bb12d6e58343881fe10869b7650f06b9c3c2/dabest/plot_tools.py#L31 https://github.com/ACCLAB/DABEST-python/blob/5d83bb12d6e58343881fe10869b7650f06b9c3c2/dabest/plot_tools.py#L47 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 https://github.com/ACCLAB/DABEST-python/blob/5d83bb12d6e58343881fe10869b7650f06b9c3c2/dabest/plot_tools.py#L1364 may already be enough.
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 :)
A suggestion: it would be great if it was compatible with plt.style.use(...) so that users can use any color cycle.
if we do decide to
Have you decided if this is something that could be added?
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
This feature has now been pushed to the dev (vnbdev) branch