Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot ONLY mean diff #107

Open
ELind77 opened this issue Nov 19, 2020 · 1 comment
Open

Plot ONLY mean diff #107

ELind77 opened this issue Nov 19, 2020 · 1 comment

Comments

@ELind77
Copy link

ELind77 commented Nov 19, 2020

Hi all,

I've really enjoyed using this library but as I scale up to larger data sets I've fount that plotting takes forever. I suspect that this is largely due to the swarm plots (though I could be wrong) and I often want to show only the mean difference plots when I summarize findings. Is there a way to plot only the mean diff plot or could such a method be added if it doesn't already exist?

-- Eric

@ELind77
Copy link
Author

ELind77 commented Nov 19, 2020

This works pretty well in a notebook:

import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from dabest import plot_tools

ax = plt.gca()

for row in db_full.mean_diff.results.itertuples():
    v = ax.violinplot(row.bootstraps[~np.isinf(row.bootstraps)], positions=[row.Index])
    plot_tools.halfviolin(v, fill_color=sns.color_palette()[row.Index])
    
    # Effect size
    ax.plot([row.Index], row.difference, marker="o", color=plt.rcParams["ytick.color"])
    # Confidence interval
    ax.plot([row.Index, row.Index], [row.bca_low, row.bca_high], linestyle="-", color=plt.rcParams["ytick.color"])

ax.set_xticks(db_full.mean_diff.results.index)
ax.set_xticklabels(db_full.mean_diff.results.test);

Would be nice to factor out this part of the plotter module so that this could be called separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants