diff --git a/dabest/_dabest_object.py b/dabest/_dabest_object.py index d61245dd..d5f0db01 100644 --- a/dabest/_dabest_object.py +++ b/dabest/_dabest_object.py @@ -112,7 +112,7 @@ def __init__( # Determine the kind of estimation plot we need to produce. if all([isinstance(i, (str, int, float)) for i in idx]): # flatten out idx. - all_plot_groups = pd.unique([t for t in idx]).tolist() + all_plot_groups = pd.unique(pd.Series([t for t in idx])).tolist() if len(idx) > len(all_plot_groups): err0 = "`idx` contains duplicated groups. Please remove any duplicates and try again." raise ValueError(err0) @@ -122,7 +122,7 @@ def __init__( self.__idx = (idx,) elif all([isinstance(i, (tuple, list)) for i in idx]): - all_plot_groups = pd.unique([tt for t in idx for tt in t]).tolist() + all_plot_groups = pd.unique(pd.Series([tt for t in idx for tt in t])).tolist() actual_groups_given = sum([len(i) for i in idx]) @@ -663,9 +663,9 @@ def _get_plot_data(self, x, y, all_plot_groups): if isinstance(plot_data[self.__xvar].dtype, pd.CategoricalDtype): - plot_data[self.__xvar].cat.remove_unused_categories(inplace=True) + plot_data[self.__xvar].cat.remove_unused_categories() plot_data[self.__xvar].cat.reorder_categories( - all_plot_groups, ordered=True, inplace=True + all_plot_groups, ordered=True ) else: plot_data[self.__xvar] = pd.Categorical( diff --git a/dabest/_effsize_objects.py b/dabest/_effsize_objects.py index 101562ed..b562b603 100644 --- a/dabest/_effsize_objects.py +++ b/dabest/_effsize_objects.py @@ -167,6 +167,8 @@ def __init__( self.__pct_interval_idx = (pct_idx_low, pct_idx_high) self.__pct_low = sorted_bootstraps[pct_idx_low] self.__pct_high = sorted_bootstraps[pct_idx_high] + + self._get_bootstrap_baseline_ec() self._perform_statistical_test() @@ -435,6 +437,92 @@ def to_dict(self): for a in attrs: out[a] = getattr(self, a) return out + + def _get_bootstrap_baseline_ec(self): + from ._stats_tools import confint_2group_diff as ci2g + from ._stats_tools import effsize as es + + # Cannot use self.__is_paired because it's for baseline curve + is_paired = None + + difference = es.two_group_difference( + self.__control, self.__control, is_paired, self.__effect_size + ) + self.__bec_difference = difference + + jackknives = ci2g.compute_meandiff_jackknife( + self.__control, self.__control, is_paired, self.__effect_size + ) + + acceleration_value = ci2g._calc_accel(jackknives) + + bootstraps = ci2g.compute_bootstrapped_diff( + self.__control, + self.__control, + is_paired, + self.__effect_size, + self.__resamples, + self.__random_seed, + ) + self.__bootstraps_baseline_ec = bootstraps + + sorted_bootstraps = npsort(self.__bootstraps_baseline_ec) + # We don't have to consider infinities in bootstrap_baseline_ec + + bias_correction = ci2g.compute_meandiff_bias_correction( + self.__bootstraps_baseline_ec, difference + ) + + # Compute BCa intervals. + bca_idx_low, bca_idx_high = ci2g.compute_interval_limits( + bias_correction, + acceleration_value, + self.__resamples, + self.__ci, + ) + + self.__bec_bca_interval_idx = (bca_idx_low, bca_idx_high) + + if ~isnan(bca_idx_low) and ~isnan(bca_idx_high): + self.__bec_bca_low = sorted_bootstraps[bca_idx_low] + self.__bec_bca_high = sorted_bootstraps[bca_idx_high] + + err1 = "The $lim_type limit of the interval" + err2 = "was in the $loc 10 values." + err3 = "The result for baseline curve should be considered unstable." + err_temp = Template(" ".join([err1, err2, err3])) + + if bca_idx_low <= 10: + warnings.warn( + err_temp.substitute(lim_type="lower", loc="bottom"), stacklevel=1 + ) + + if bca_idx_high >= self.__resamples - 9: + warnings.warn( + err_temp.substitute(lim_type="upper", loc="top"), stacklevel=1 + ) + + else: + err1 = "The $lim_type limit of the BCa interval of baseline curve cannot be computed." + err2 = "It is set to the effect size itself." + err3 = "All bootstrap values were likely all the same." + err_temp = Template(" ".join([err1, err2, err3])) + + if isnan(bca_idx_low): + self.__bec_bca_low = difference + warnings.warn(err_temp.substitute(lim_type="lower"), stacklevel=0) + + if isnan(bca_idx_high): + self.__bec_bca_high = difference + warnings.warn(err_temp.substitute(lim_type="upper"), stacklevel=0) + + # Compute percentile intervals. + pct_idx_low = int((self.__alpha / 2) * self.__resamples) + pct_idx_high = int((1 - (self.__alpha / 2)) * self.__resamples) + + self.__bec_pct_interval_idx = (pct_idx_low, pct_idx_high) + self.__bec_pct_low = sorted_bootstraps[pct_idx_low] + self.__bec_pct_high = sorted_bootstraps[pct_idx_high] @property def difference(self): @@ -671,6 +759,54 @@ def proportional_difference(self): return self.__proportional_difference except AttributeError: return npnan + + @property + def bec_difference(self): + return self.__bec_difference + + @property + def bec_bootstraps(self): + """ + The generated baseline error bootstraps. + """ + return self.__bootstraps_baseline_ec + + @property + def bec_bca_interval_idx(self): + return self.__bec_bca_interval_idx + + @property + def bec_bca_low(self): + """ + The bias-corrected and accelerated confidence interval lower limit for baseline error. + """ + return self.__bec_bca_low + + @property + def bec_bca_high(self): + """ + The bias-corrected and accelerated confidence interval upper limit for baseline error. + """ + return self.__bec_bca_high + + @property + def bec_pct_interval_idx(self): + return self.__bec_pct_interval_idx + + @property + def bec_pct_low(self): + """ + The percentile confidence interval lower limit for baseline error. + """ + return self.__bec_pct_low + + @property + def bec_pct_high(self): + """ + The percentile confidence interval lower limit for baseline error. + """ + return self.__bec_pct_high + # %% ../nbs/API/effsize_objects.ipynb 10 class EffectSizeDataFrame(object): @@ -843,6 +979,14 @@ def __pre_calc(self): "pvalue_kruskal", "statistic_kruskal", "proportional_difference", + "bec_difference", + "bec_bootstraps", + "bec_bca_interval_idx", + "bec_bca_low", + "bec_bca_high", + "bec_pct_interval_idx", + "bec_pct_low", + "bec_pct_high", ] self.__results = out_.reindex(columns=columns_in_order) self.__results.dropna(axis="columns", how="all", inplace=True) @@ -1027,6 +1171,7 @@ def plot( delta_text_kwargs=None, delta_dot=True, delta_dot_kwargs=None, + show_baseline_ec=False, ): """ Creates an estimation plot for the effect size of interest. @@ -1208,6 +1353,13 @@ def plot( delta_dot_kwargs : dict, default None Pass relevant keyword arguments. If None, the following keywords are passed: {"marker": "^", "alpha": 0.5, "zorder": 2, "size": 3, "side": "right"} + show_baseline_ec : boolean, default False + Whether or not to display the baseline error curve. The baseline error curve + represents the distribution of the effect size when comparing the control + group to itself, providing a reference for the inherent variability or noise + in the data. When True, this curve is plotted alongside the main effect size + distribution, allowing for a visual comparison of the observed effect against + the baseline variability. Returns ------- diff --git a/dabest/misc_tools.py b/dabest/misc_tools.py index 3295a3e9..6836d336 100644 --- a/dabest/misc_tools.py +++ b/dabest/misc_tools.py @@ -154,8 +154,12 @@ def get_params(effectsize_df, plot_kwargs): if err_color is None: err_color = "black" + # Boolean for showing Baseline Curve + show_baseline_ec = plot_kwargs["show_baseline_ec"] + return (dabest_obj, plot_data, xvar, yvar, is_paired, effect_size, proportional, all_plot_groups, idx, - show_delta2, show_mini_meta, float_contrast, show_pairs, effect_size_type, group_summaries, err_color) + show_delta2, show_mini_meta, float_contrast, show_pairs, effect_size_type, group_summaries, err_color, + show_baseline_ec) def get_kwargs(plot_kwargs, ytick_color): """ @@ -627,7 +631,9 @@ def extract_contrast_plotting_ticks(is_paired, show_pairs, two_col_sankey, plot_ t for t in range(0, len(plot_groups)) if t not in ticks_to_skip ] - return ticks_to_skip, ticks_to_plot, ticks_to_skip_contrast, ticks_to_start_twocol_sankey + ticks_for_baseline_ec = ticks_to_skip + + return ticks_to_skip, ticks_to_plot, ticks_for_baseline_ec, ticks_to_skip_contrast, ticks_to_start_twocol_sankey def set_xaxis_ticks_and_lims(show_delta2, show_mini_meta, rawdata_axes, contrast_axes, show_pairs, float_contrast, ticks_to_skip, contrast_xtick_labels, plot_kwargs): @@ -904,70 +910,70 @@ def Cumming_Plot_Aesthetic_Adjustments(plot_kwargs, show_delta2, effect_size_typ contrast_axes.axhline(y=0, **reflines_kwargs) if is_paired == "baseline" and show_pairs: - if two_col_sankey: - rightend_ticks_raw = np.array([len(i) - 2 for i in idx]) + np.array( - ticks_to_start_twocol_sankey - ) - elif proportional and is_paired is not None: - rightend_ticks_raw = np.array([len(i) - 1 for i in idx]) + np.array( - ticks_to_skip - ) - else: - rightend_ticks_raw = np.array( - [len(i) - 1 for i in temp_idx] - ) + np.array(ticks_to_skip) - for ax in [rawdata_axes]: - sns.despine(ax=ax, bottom=True) - - ylim = ax.get_ylim() - xlim = ax.get_xlim() - redraw_axes_kwargs["y"] = ylim[0] - - if two_col_sankey: - for k, start_tick in enumerate(ticks_to_start_twocol_sankey): - end_tick = rightend_ticks_raw[k] - ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) - else: - for k, start_tick in enumerate(ticks_to_skip): - end_tick = rightend_ticks_raw[k] - ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) - ax.set_ylim(ylim) - del redraw_axes_kwargs["y"] - - if not proportional: - temp_length = [(len(i) - 1) for i in idx] - else: - temp_length = [(len(i) - 1) * 2 - 1 for i in idx] - if two_col_sankey: - rightend_ticks_contrast = np.array( - [len(i) - 2 for i in idx] - ) + np.array(ticks_to_start_twocol_sankey) - elif proportional and is_paired is not None: - rightend_ticks_contrast = np.array( - [len(i) - 1 for i in idx] - ) + np.array(ticks_to_skip) - else: - rightend_ticks_contrast = np.array(temp_length) + np.array( - ticks_to_skip_contrast - ) - for ax in [contrast_axes]: - sns.despine(ax=ax, bottom=True) - - ylim = ax.get_ylim() - xlim = ax.get_xlim() - redraw_axes_kwargs["y"] = ylim[0] - - if two_col_sankey: - for k, start_tick in enumerate(ticks_to_start_twocol_sankey): - end_tick = rightend_ticks_contrast[k] - ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) - else: - for k, start_tick in enumerate(ticks_to_skip_contrast): - end_tick = rightend_ticks_contrast[k] - ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) - - ax.set_ylim(ylim) - del redraw_axes_kwargs["y"] + if two_col_sankey: + rightend_ticks_raw = np.array([len(i) - 2 for i in idx]) + np.array( + ticks_to_start_twocol_sankey + ) + elif proportional and is_paired is not None: + rightend_ticks_raw = np.array([len(i) - 1 for i in idx]) + np.array( + ticks_to_skip + ) + else: + rightend_ticks_raw = np.array( + [len(i) - 1 for i in temp_idx] + ) + np.array(ticks_to_skip) + for ax in [rawdata_axes]: + sns.despine(ax=ax, bottom=True) + + ylim = ax.get_ylim() + xlim = ax.get_xlim() + redraw_axes_kwargs["y"] = ylim[0] + + if two_col_sankey: + for k, start_tick in enumerate(ticks_to_start_twocol_sankey): + end_tick = rightend_ticks_raw[k] + ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) + else: + for k, start_tick in enumerate(ticks_to_skip): + end_tick = rightend_ticks_raw[k] + ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) + ax.set_ylim(ylim) + del redraw_axes_kwargs["y"] + + if not proportional: + temp_length = [(len(i) - 1) for i in idx] + else: + temp_length = [(len(i) - 1) * 2 - 1 for i in idx] + if two_col_sankey: + rightend_ticks_contrast = np.array( + [len(i) - 2 for i in idx] + ) + np.array(ticks_to_start_twocol_sankey) + elif proportional and is_paired is not None: + rightend_ticks_contrast = np.array( + [len(i) - 1 for i in idx] + ) + np.array(ticks_to_skip) + else: + rightend_ticks_contrast = np.array(temp_length) + np.array( + ticks_to_skip_contrast + ) + for ax in [contrast_axes]: + sns.despine(ax=ax, bottom=True) + + ylim = ax.get_ylim() + xlim = ax.get_xlim() + redraw_axes_kwargs["y"] = ylim[0] + + if two_col_sankey: + for k, start_tick in enumerate(ticks_to_start_twocol_sankey): + end_tick = rightend_ticks_contrast[k] + ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) + else: + for k, start_tick in enumerate(ticks_to_skip_contrast): + end_tick = rightend_ticks_contrast[k] + ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs) + + ax.set_ylim(ylim) + del redraw_axes_kwargs["y"] else: # Compute the end of each x-axes line. if two_col_sankey: diff --git a/dabest/plot_tools.py b/dabest/plot_tools.py index 2d82053e..72437f38 100644 --- a/dabest/plot_tools.py +++ b/dabest/plot_tools.py @@ -1269,40 +1269,50 @@ def plot_minimeta_or_deltadelta_violins(show_mini_meta, effectsize_df, ci_type, return contrast_xtick_labels -def effect_size_curve_plotter(ticks_to_plot, results, ci_type, contrast_axes, violinplot_kwargs, halfviolin_alpha, - ytick_color, es_marker_size, group_summary_kwargs, bootstraps_color_by_group, plot_palette_contrast): +def effect_size_curve_plotter(ticks_to_plot, ticks_for_baseline_ec, results, ci_type, contrast_axes, + violinplot_kwargs, halfviolin_alpha, ytick_color, es_marker_size, + group_summary_kwargs, bootstraps_color_by_group, plot_palette_contrast, + show_baseline_ec): contrast_xtick_labels = [] - for j, tick in enumerate(ticks_to_plot): - current_group = results.test[j] - current_control = results.control[j] - current_bootstrap = results.bootstraps[j] - current_effsize = results.difference[j] - if ci_type == "bca": - current_ci_low = results.bca_low[j] - current_ci_high = results.bca_high[j] - else: - current_ci_low = results.pct_low[j] - current_ci_high = results.pct_high[j] - - # Create the violinplot. + + def plot_effect_size(tick, group, control, bootstrap, effsize, ci_low, ci_high): + # Create the violinplot # New in v0.2.6: drop negative infinities before plotting. v = contrast_axes.violinplot( - current_bootstrap[~np.isinf(current_bootstrap)], + bootstrap[~np.isinf(bootstrap)], positions=[tick], **violinplot_kwargs ) + + # Color the violin plot # Turn the violinplot into half, and color it the same as the swarmplot. # Do this only if the color column is not specified. # Ideally, the alpha (transparency) fo the violin plot should be # less than one so the effect size and CIs are visible. - if bootstraps_color_by_group: - fc = plot_palette_contrast[current_group] - else: - fc = "grey" - + fc = plot_palette_contrast[group] if bootstraps_color_by_group else "grey" halfviolin(v, fill_color=fc, alpha=halfviolin_alpha) - # Plot the effect size. + # Plot the confidence interval + contrast_axes.plot( + [tick, tick], + [ci_low, ci_high], + linestyle="-", + color=ytick_color, + linewidth=group_summary_kwargs["lw"], + ) + + return "{}\nminus\n{}".format(group, control) + + # Plot for ticks_to_plot + for j, tick in enumerate(ticks_to_plot): + current_group = results.test[j] + current_control = results.control[j] + current_bootstrap = results.bootstraps[j] + current_effsize = results.difference[j] + current_ci_low = results.bca_low[j] if ci_type == "bca" else results.pct_low[j] + current_ci_high = results.bca_high[j] if ci_type == "bca" else results.pct_high[j] + + # Plot the effect size contrast_axes.plot( [tick], current_effsize, @@ -1311,18 +1321,34 @@ def effect_size_curve_plotter(ticks_to_plot, results, ci_type, contrast_axes, vi markersize=es_marker_size, ) - # Plot the confidence interval. + label = plot_effect_size(tick, current_group, current_control, current_bootstrap, + current_effsize, current_ci_low, current_ci_high) + contrast_xtick_labels.append(label) + + + bec_results = results.drop_duplicates(subset='control', keep='first').reset_index(drop=True) + for j, tick in enumerate(ticks_for_baseline_ec): + bec_group = bec_results.control[j] + bec_control = bec_results.control[j] + bec_bootstrap = bec_results.bec_bootstraps[j] + bec_effsize = bec_results.bec_difference[j] + bec_ci_low = bec_results.bec_bca_low[j] if ci_type == "bca" else bec_results.bec_pct_low[j] + bec_ci_high = bec_results.bec_bca_high[j] if ci_type == "bca" else bec_results.bec_pct_high[j] + + # Plot the effect size no matter show_baseline contrast_axes.plot( - [tick, tick], - [current_ci_low, current_ci_high], - linestyle="-", + [tick], + bec_effsize, + marker="o", color=ytick_color, - linewidth=group_summary_kwargs["lw"], - ) - - contrast_xtick_labels.append( - "{}\nminus\n{}".format(current_group, current_control) + markersize=es_marker_size, ) + + if show_baseline_ec: + _ = plot_effect_size(tick, bec_group, bec_control, bec_bootstrap, + bec_effsize, bec_ci_low, bec_ci_high) + # Baseline Curve don't need ticks text + return current_group, current_control, current_effsize, contrast_xtick_labels diff --git a/dabest/plotter.py b/dabest/plotter.py index 86e8239a..ce2ce6a3 100644 --- a/dabest/plotter.py +++ b/dabest/plotter.py @@ -61,6 +61,7 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs): contrast_bars=True, contrast_bars_kwargs=None, delta_text=True, delta_text_kwargs=None, delta_dot=True, delta_dot_kwargs=None, + show_baseline_ec=False, """ from .misc_tools import ( get_params, @@ -111,9 +112,9 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs): ytick_color = plt.rcParams["ytick.color"] # Extract parameters and set kwargs - (dabest_obj, plot_data, xvar, yvar, is_paired, effect_size, - proportional, all_plot_groups, idx, show_delta2, show_mini_meta, - float_contrast, show_pairs, effect_size_type, group_summaries, err_color) = get_params( + (dabest_obj, plot_data, xvar, yvar, is_paired, effect_size, proportional, + all_plot_groups, idx, show_delta2, show_mini_meta, float_contrast, + show_pairs, effect_size_type, group_summaries, err_color, show_baseline_ec) = get_params( effectsize_df=effectsize_df, plot_kwargs=plot_kwargs ) @@ -332,7 +333,7 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs): # Plot effect sizes and bootstraps. plot_groups = temp_all_plot_groups if (is_paired == "baseline" and show_pairs and two_col_sankey) else temp_idx if (two_col_sankey) else all_plot_groups - (ticks_to_skip, ticks_to_plot, + (ticks_to_skip, ticks_to_plot, ticks_for_baseline_ec, ticks_to_skip_contrast, ticks_to_start_twocol_sankey) = extract_contrast_plotting_ticks( is_paired=is_paired, show_pairs=show_pairs, @@ -349,9 +350,10 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs): results = effectsize_df.results - (current_group, current_control, + (current_group, current_control, current_effsize, contrast_xtick_labels) = effect_size_curve_plotter( ticks_to_plot=ticks_to_plot, + ticks_for_baseline_ec=ticks_for_baseline_ec, results=results, ci_type=ci_type, contrast_axes=contrast_axes, @@ -362,6 +364,7 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs): group_summary_kwargs=group_summary_kwargs, bootstraps_color_by_group=bootstraps_color_by_group, plot_palette_contrast=plot_palette_contrast, + show_baseline_ec=show_baseline_ec, ) # Plot mini-meta violin diff --git a/nbs/API/dabest_object.ipynb b/nbs/API/dabest_object.ipynb index 48576a87..35c8d5c3 100644 --- a/nbs/API/dabest_object.ipynb +++ b/nbs/API/dabest_object.ipynb @@ -180,7 +180,7 @@ " # Determine the kind of estimation plot we need to produce.\n", " if all([isinstance(i, (str, int, float)) for i in idx]):\n", " # flatten out idx.\n", - " all_plot_groups = pd.unique([t for t in idx]).tolist()\n", + " all_plot_groups = pd.unique(pd.Series([t for t in idx])).tolist()\n", " if len(idx) > len(all_plot_groups):\n", " err0 = \"`idx` contains duplicated groups. Please remove any duplicates and try again.\"\n", " raise ValueError(err0)\n", @@ -190,7 +190,7 @@ " self.__idx = (idx,)\n", "\n", " elif all([isinstance(i, (tuple, list)) for i in idx]):\n", - " all_plot_groups = pd.unique([tt for t in idx for tt in t]).tolist()\n", + " all_plot_groups = pd.unique(pd.Series([tt for t in idx for tt in t])).tolist()\n", "\n", " actual_groups_given = sum([len(i) for i in idx])\n", "\n", @@ -731,9 +731,9 @@ "\n", "\n", " if isinstance(plot_data[self.__xvar].dtype, pd.CategoricalDtype):\n", - " plot_data[self.__xvar].cat.remove_unused_categories(inplace=True)\n", + " plot_data[self.__xvar].cat.remove_unused_categories()\n", " plot_data[self.__xvar].cat.reorder_categories(\n", - " all_plot_groups, ordered=True, inplace=True\n", + " all_plot_groups, ordered=True\n", " )\n", " else:\n", " plot_data[self.__xvar] = pd.Categorical(\n", diff --git a/nbs/API/effsize_objects.ipynb b/nbs/API/effsize_objects.ipynb index 4d0bde93..da633fda 100644 --- a/nbs/API/effsize_objects.ipynb +++ b/nbs/API/effsize_objects.ipynb @@ -227,6 +227,8 @@ " self.__pct_interval_idx = (pct_idx_low, pct_idx_high)\n", " self.__pct_low = sorted_bootstraps[pct_idx_low]\n", " self.__pct_high = sorted_bootstraps[pct_idx_high]\n", + " \n", + " self._get_bootstrap_baseline_ec()\n", "\n", " self._perform_statistical_test()\n", "\n", @@ -495,6 +497,92 @@ " for a in attrs:\n", " out[a] = getattr(self, a)\n", " return out\n", + " \n", + " def _get_bootstrap_baseline_ec(self):\n", + " from ._stats_tools import confint_2group_diff as ci2g\n", + " from ._stats_tools import effsize as es\n", + " \n", + " # Cannot use self.__is_paired because it's for baseline curve\n", + " is_paired = None\n", + " \n", + " difference = es.two_group_difference(\n", + " self.__control, self.__control, is_paired, self.__effect_size\n", + " )\n", + " self.__bec_difference = difference\n", + "\n", + " jackknives = ci2g.compute_meandiff_jackknife(\n", + " self.__control, self.__control, is_paired, self.__effect_size\n", + " )\n", + "\n", + " acceleration_value = ci2g._calc_accel(jackknives)\n", + "\n", + " bootstraps = ci2g.compute_bootstrapped_diff(\n", + " self.__control,\n", + " self.__control,\n", + " is_paired,\n", + " self.__effect_size,\n", + " self.__resamples,\n", + " self.__random_seed,\n", + " )\n", + " self.__bootstraps_baseline_ec = bootstraps\n", + "\n", + " sorted_bootstraps = npsort(self.__bootstraps_baseline_ec)\n", + " # We don't have to consider infinities in bootstrap_baseline_ec\n", + "\n", + " bias_correction = ci2g.compute_meandiff_bias_correction(\n", + " self.__bootstraps_baseline_ec, difference\n", + " )\n", + "\n", + " # Compute BCa intervals.\n", + " bca_idx_low, bca_idx_high = ci2g.compute_interval_limits(\n", + " bias_correction,\n", + " acceleration_value,\n", + " self.__resamples,\n", + " self.__ci,\n", + " )\n", + "\n", + " self.__bec_bca_interval_idx = (bca_idx_low, bca_idx_high)\n", + "\n", + " if ~isnan(bca_idx_low) and ~isnan(bca_idx_high):\n", + " self.__bec_bca_low = sorted_bootstraps[bca_idx_low]\n", + " self.__bec_bca_high = sorted_bootstraps[bca_idx_high]\n", + "\n", + " err1 = \"The $lim_type limit of the interval\"\n", + " err2 = \"was in the $loc 10 values.\"\n", + " err3 = \"The result for baseline curve should be considered unstable.\"\n", + " err_temp = Template(\" \".join([err1, err2, err3]))\n", + "\n", + " if bca_idx_low <= 10:\n", + " warnings.warn(\n", + " err_temp.substitute(lim_type=\"lower\", loc=\"bottom\"), stacklevel=1\n", + " )\n", + "\n", + " if bca_idx_high >= self.__resamples - 9:\n", + " warnings.warn(\n", + " err_temp.substitute(lim_type=\"upper\", loc=\"top\"), stacklevel=1\n", + " )\n", + "\n", + " else:\n", + " err1 = \"The $lim_type limit of the BCa interval of baseline curve cannot be computed.\"\n", + " err2 = \"It is set to the effect size itself.\"\n", + " err3 = \"All bootstrap values were likely all the same.\"\n", + " err_temp = Template(\" \".join([err1, err2, err3]))\n", + "\n", + " if isnan(bca_idx_low):\n", + " self.__bec_bca_low = difference\n", + " warnings.warn(err_temp.substitute(lim_type=\"lower\"), stacklevel=0)\n", + "\n", + " if isnan(bca_idx_high):\n", + " self.__bec_bca_high = difference\n", + " warnings.warn(err_temp.substitute(lim_type=\"upper\"), stacklevel=0)\n", + "\n", + " # Compute percentile intervals.\n", + " pct_idx_low = int((self.__alpha / 2) * self.__resamples)\n", + " pct_idx_high = int((1 - (self.__alpha / 2)) * self.__resamples)\n", + "\n", + " self.__bec_pct_interval_idx = (pct_idx_low, pct_idx_high)\n", + " self.__bec_pct_low = sorted_bootstraps[pct_idx_low]\n", + " self.__bec_pct_high = sorted_bootstraps[pct_idx_high]\n", "\n", " @property\n", " def difference(self):\n", @@ -730,7 +818,55 @@ " try:\n", " return self.__proportional_difference\n", " except AttributeError:\n", - " return npnan" + " return npnan\n", + " \n", + " @property\n", + " def bec_difference(self):\n", + " return self.__bec_difference \n", + " \n", + " @property\n", + " def bec_bootstraps(self):\n", + " \"\"\"\n", + " The generated baseline error bootstraps.\n", + " \"\"\"\n", + " return self.__bootstraps_baseline_ec\n", + "\n", + " @property\n", + " def bec_bca_interval_idx(self):\n", + " return self.__bec_bca_interval_idx\n", + "\n", + " @property\n", + " def bec_bca_low(self):\n", + " \"\"\"\n", + " The bias-corrected and accelerated confidence interval lower limit for baseline error.\n", + " \"\"\"\n", + " return self.__bec_bca_low\n", + "\n", + " @property\n", + " def bec_bca_high(self):\n", + " \"\"\"\n", + " The bias-corrected and accelerated confidence interval upper limit for baseline error.\n", + " \"\"\"\n", + " return self.__bec_bca_high\n", + "\n", + " @property\n", + " def bec_pct_interval_idx(self):\n", + " return self.__bec_pct_interval_idx\n", + "\n", + " @property\n", + " def bec_pct_low(self):\n", + " \"\"\"\n", + " The percentile confidence interval lower limit for baseline error.\n", + " \"\"\"\n", + " return self.__bec_pct_low\n", + "\n", + " @property\n", + " def bec_pct_high(self):\n", + " \"\"\"\n", + " The percentile confidence interval lower limit for baseline error.\n", + " \"\"\"\n", + " return self.__bec_pct_high\n", + " " ] }, { @@ -1002,6 +1138,14 @@ " \"pvalue_kruskal\",\n", " \"statistic_kruskal\",\n", " \"proportional_difference\",\n", + " \"bec_difference\",\n", + " \"bec_bootstraps\",\n", + " \"bec_bca_interval_idx\",\n", + " \"bec_bca_low\",\n", + " \"bec_bca_high\",\n", + " \"bec_pct_interval_idx\",\n", + " \"bec_pct_low\",\n", + " \"bec_pct_high\",\n", " ]\n", " self.__results = out_.reindex(columns=columns_in_order)\n", " self.__results.dropna(axis=\"columns\", how=\"all\", inplace=True)\n", @@ -1186,6 +1330,7 @@ " delta_text_kwargs=None,\n", " delta_dot=True,\n", " delta_dot_kwargs=None,\n", + " show_baseline_ec=False,\n", " ):\n", " \"\"\"\n", " Creates an estimation plot for the effect size of interest.\n", @@ -1367,6 +1512,13 @@ " delta_dot_kwargs : dict, default None\n", " Pass relevant keyword arguments. If None, the following keywords are passed:\n", " {\"marker\": \"^\", \"alpha\": 0.5, \"zorder\": 2, \"size\": 3, \"side\": \"right\"}\n", + " show_baseline_ec : boolean, default False\n", + " Whether or not to display the baseline error curve. The baseline error curve\n", + " represents the distribution of the effect size when comparing the control\n", + " group to itself, providing a reference for the inherent variability or noise\n", + " in the data. When True, this curve is plotted alongside the main effect size\n", + " distribution, allowing for a visual comparison of the observed effect against\n", + " the baseline variability.\n", "\n", " Returns\n", " -------\n", diff --git a/nbs/API/misc_tools.ipynb b/nbs/API/misc_tools.ipynb index c8440e2b..64eda8c4 100644 --- a/nbs/API/misc_tools.ipynb +++ b/nbs/API/misc_tools.ipynb @@ -207,8 +207,12 @@ " if err_color is None: \n", " err_color = \"black\"\n", " \n", + " # Boolean for showing Baseline Curve\n", + " show_baseline_ec = plot_kwargs[\"show_baseline_ec\"]\n", + " \n", " return (dabest_obj, plot_data, xvar, yvar, is_paired, effect_size, proportional, all_plot_groups, idx, \n", - " show_delta2, show_mini_meta, float_contrast, show_pairs, effect_size_type, group_summaries, err_color)\n", + " show_delta2, show_mini_meta, float_contrast, show_pairs, effect_size_type, group_summaries, err_color,\n", + " show_baseline_ec)\n", "\n", "def get_kwargs(plot_kwargs, ytick_color):\n", " \"\"\"\n", @@ -680,7 +684,9 @@ " t for t in range(0, len(plot_groups)) if t not in ticks_to_skip\n", " ]\n", " \n", - " return ticks_to_skip, ticks_to_plot, ticks_to_skip_contrast, ticks_to_start_twocol_sankey\n", + " ticks_for_baseline_ec = ticks_to_skip\n", + " \n", + " return ticks_to_skip, ticks_to_plot, ticks_for_baseline_ec, ticks_to_skip_contrast, ticks_to_start_twocol_sankey\n", "\n", "def set_xaxis_ticks_and_lims(show_delta2, show_mini_meta, rawdata_axes, contrast_axes, show_pairs, float_contrast,\n", " ticks_to_skip, contrast_xtick_labels, plot_kwargs):\n", @@ -957,70 +963,70 @@ " contrast_axes.axhline(y=0, **reflines_kwargs)\n", "\n", " if is_paired == \"baseline\" and show_pairs:\n", - " if two_col_sankey:\n", - " rightend_ticks_raw = np.array([len(i) - 2 for i in idx]) + np.array(\n", - " ticks_to_start_twocol_sankey\n", - " )\n", - " elif proportional and is_paired is not None:\n", - " rightend_ticks_raw = np.array([len(i) - 1 for i in idx]) + np.array(\n", - " ticks_to_skip\n", - " )\n", - " else:\n", - " rightend_ticks_raw = np.array(\n", - " [len(i) - 1 for i in temp_idx]\n", - " ) + np.array(ticks_to_skip)\n", - " for ax in [rawdata_axes]:\n", - " sns.despine(ax=ax, bottom=True)\n", - "\n", - " ylim = ax.get_ylim()\n", - " xlim = ax.get_xlim()\n", - " redraw_axes_kwargs[\"y\"] = ylim[0]\n", - "\n", - " if two_col_sankey:\n", - " for k, start_tick in enumerate(ticks_to_start_twocol_sankey):\n", - " end_tick = rightend_ticks_raw[k]\n", - " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", - " else:\n", - " for k, start_tick in enumerate(ticks_to_skip):\n", - " end_tick = rightend_ticks_raw[k]\n", - " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", - " ax.set_ylim(ylim)\n", - " del redraw_axes_kwargs[\"y\"]\n", - "\n", - " if not proportional:\n", - " temp_length = [(len(i) - 1) for i in idx]\n", - " else:\n", - " temp_length = [(len(i) - 1) * 2 - 1 for i in idx]\n", - " if two_col_sankey:\n", - " rightend_ticks_contrast = np.array(\n", - " [len(i) - 2 for i in idx]\n", - " ) + np.array(ticks_to_start_twocol_sankey)\n", - " elif proportional and is_paired is not None:\n", - " rightend_ticks_contrast = np.array(\n", - " [len(i) - 1 for i in idx]\n", - " ) + np.array(ticks_to_skip)\n", - " else:\n", - " rightend_ticks_contrast = np.array(temp_length) + np.array(\n", - " ticks_to_skip_contrast\n", - " )\n", - " for ax in [contrast_axes]:\n", - " sns.despine(ax=ax, bottom=True)\n", - "\n", - " ylim = ax.get_ylim()\n", - " xlim = ax.get_xlim()\n", - " redraw_axes_kwargs[\"y\"] = ylim[0]\n", - "\n", - " if two_col_sankey:\n", - " for k, start_tick in enumerate(ticks_to_start_twocol_sankey):\n", - " end_tick = rightend_ticks_contrast[k]\n", - " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", - " else:\n", - " for k, start_tick in enumerate(ticks_to_skip_contrast):\n", - " end_tick = rightend_ticks_contrast[k]\n", - " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", - "\n", - " ax.set_ylim(ylim)\n", - " del redraw_axes_kwargs[\"y\"]\n", + " if two_col_sankey:\n", + " rightend_ticks_raw = np.array([len(i) - 2 for i in idx]) + np.array(\n", + " ticks_to_start_twocol_sankey\n", + " )\n", + " elif proportional and is_paired is not None:\n", + " rightend_ticks_raw = np.array([len(i) - 1 for i in idx]) + np.array(\n", + " ticks_to_skip\n", + " )\n", + " else:\n", + " rightend_ticks_raw = np.array(\n", + " [len(i) - 1 for i in temp_idx]\n", + " ) + np.array(ticks_to_skip)\n", + " for ax in [rawdata_axes]:\n", + " sns.despine(ax=ax, bottom=True)\n", + "\n", + " ylim = ax.get_ylim()\n", + " xlim = ax.get_xlim()\n", + " redraw_axes_kwargs[\"y\"] = ylim[0]\n", + "\n", + " if two_col_sankey:\n", + " for k, start_tick in enumerate(ticks_to_start_twocol_sankey):\n", + " end_tick = rightend_ticks_raw[k]\n", + " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", + " else:\n", + " for k, start_tick in enumerate(ticks_to_skip):\n", + " end_tick = rightend_ticks_raw[k]\n", + " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", + " ax.set_ylim(ylim)\n", + " del redraw_axes_kwargs[\"y\"]\n", + "\n", + " if not proportional:\n", + " temp_length = [(len(i) - 1) for i in idx]\n", + " else:\n", + " temp_length = [(len(i) - 1) * 2 - 1 for i in idx]\n", + " if two_col_sankey:\n", + " rightend_ticks_contrast = np.array(\n", + " [len(i) - 2 for i in idx]\n", + " ) + np.array(ticks_to_start_twocol_sankey)\n", + " elif proportional and is_paired is not None:\n", + " rightend_ticks_contrast = np.array(\n", + " [len(i) - 1 for i in idx]\n", + " ) + np.array(ticks_to_skip)\n", + " else:\n", + " rightend_ticks_contrast = np.array(temp_length) + np.array(\n", + " ticks_to_skip_contrast\n", + " )\n", + " for ax in [contrast_axes]:\n", + " sns.despine(ax=ax, bottom=True)\n", + "\n", + " ylim = ax.get_ylim()\n", + " xlim = ax.get_xlim()\n", + " redraw_axes_kwargs[\"y\"] = ylim[0]\n", + "\n", + " if two_col_sankey:\n", + " for k, start_tick in enumerate(ticks_to_start_twocol_sankey):\n", + " end_tick = rightend_ticks_contrast[k]\n", + " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", + " else:\n", + " for k, start_tick in enumerate(ticks_to_skip_contrast):\n", + " end_tick = rightend_ticks_contrast[k]\n", + " ax.hlines(xmin=start_tick, xmax=end_tick, **redraw_axes_kwargs)\n", + "\n", + " ax.set_ylim(ylim)\n", + " del redraw_axes_kwargs[\"y\"]\n", " else:\n", " # Compute the end of each x-axes line.\n", " if two_col_sankey:\n", diff --git a/nbs/API/plot_tools.ipynb b/nbs/API/plot_tools.ipynb index 524295ab..2c431029 100644 --- a/nbs/API/plot_tools.ipynb +++ b/nbs/API/plot_tools.ipynb @@ -1320,40 +1320,50 @@ " return contrast_xtick_labels\n", "\n", "\n", - "def effect_size_curve_plotter(ticks_to_plot, results, ci_type, contrast_axes, violinplot_kwargs, halfviolin_alpha, \n", - " ytick_color, es_marker_size, group_summary_kwargs, bootstraps_color_by_group, plot_palette_contrast):\n", + "def effect_size_curve_plotter(ticks_to_plot, ticks_for_baseline_ec, results, ci_type, contrast_axes, \n", + " violinplot_kwargs, halfviolin_alpha, ytick_color, es_marker_size, \n", + " group_summary_kwargs, bootstraps_color_by_group, plot_palette_contrast,\n", + " show_baseline_ec):\n", " contrast_xtick_labels = []\n", - " for j, tick in enumerate(ticks_to_plot):\n", - " current_group = results.test[j]\n", - " current_control = results.control[j]\n", - " current_bootstrap = results.bootstraps[j]\n", - " current_effsize = results.difference[j]\n", - " if ci_type == \"bca\":\n", - " current_ci_low = results.bca_low[j]\n", - " current_ci_high = results.bca_high[j]\n", - " else:\n", - " current_ci_low = results.pct_low[j]\n", - " current_ci_high = results.pct_high[j]\n", - "\n", - " # Create the violinplot.\n", + " \n", + " def plot_effect_size(tick, group, control, bootstrap, effsize, ci_low, ci_high):\n", + " # Create the violinplot\n", " # New in v0.2.6: drop negative infinities before plotting.\n", " v = contrast_axes.violinplot(\n", - " current_bootstrap[~np.isinf(current_bootstrap)],\n", + " bootstrap[~np.isinf(bootstrap)],\n", " positions=[tick],\n", " **violinplot_kwargs\n", " )\n", + " \n", + " # Color the violin plot\n", " # Turn the violinplot into half, and color it the same as the swarmplot.\n", " # Do this only if the color column is not specified.\n", " # Ideally, the alpha (transparency) fo the violin plot should be\n", " # less than one so the effect size and CIs are visible.\n", - " if bootstraps_color_by_group:\n", - " fc = plot_palette_contrast[current_group]\n", - " else:\n", - " fc = \"grey\"\n", - "\n", + " fc = plot_palette_contrast[group] if bootstraps_color_by_group else \"grey\"\n", " halfviolin(v, fill_color=fc, alpha=halfviolin_alpha)\n", "\n", - " # Plot the effect size.\n", + " # Plot the confidence interval\n", + " contrast_axes.plot(\n", + " [tick, tick],\n", + " [ci_low, ci_high],\n", + " linestyle=\"-\",\n", + " color=ytick_color,\n", + " linewidth=group_summary_kwargs[\"lw\"],\n", + " ) \n", + " \n", + " return \"{}\\nminus\\n{}\".format(group, control)\n", + " \n", + " # Plot for ticks_to_plot\n", + " for j, tick in enumerate(ticks_to_plot):\n", + " current_group = results.test[j]\n", + " current_control = results.control[j]\n", + " current_bootstrap = results.bootstraps[j]\n", + " current_effsize = results.difference[j]\n", + " current_ci_low = results.bca_low[j] if ci_type == \"bca\" else results.pct_low[j]\n", + " current_ci_high = results.bca_high[j] if ci_type == \"bca\" else results.pct_high[j]\n", + " \n", + " # Plot the effect size\n", " contrast_axes.plot(\n", " [tick],\n", " current_effsize,\n", @@ -1362,18 +1372,34 @@ " markersize=es_marker_size,\n", " )\n", "\n", - " # Plot the confidence interval.\n", + " label = plot_effect_size(tick, current_group, current_control, current_bootstrap, \n", + " current_effsize, current_ci_low, current_ci_high)\n", + " contrast_xtick_labels.append(label)\n", + " \n", + "\n", + " bec_results = results.drop_duplicates(subset='control', keep='first').reset_index(drop=True)\n", + " for j, tick in enumerate(ticks_for_baseline_ec):\n", + " bec_group = bec_results.control[j]\n", + " bec_control = bec_results.control[j]\n", + " bec_bootstrap = bec_results.bec_bootstraps[j]\n", + " bec_effsize = bec_results.bec_difference[j]\n", + " bec_ci_low = bec_results.bec_bca_low[j] if ci_type == \"bca\" else bec_results.bec_pct_low[j]\n", + " bec_ci_high = bec_results.bec_bca_high[j] if ci_type == \"bca\" else bec_results.bec_pct_high[j]\n", + " \n", + " # Plot the effect size no matter show_baseline\n", " contrast_axes.plot(\n", - " [tick, tick],\n", - " [current_ci_low, current_ci_high],\n", - " linestyle=\"-\",\n", + " [tick],\n", + " bec_effsize,\n", + " marker=\"o\",\n", " color=ytick_color,\n", - " linewidth=group_summary_kwargs[\"lw\"],\n", - " )\n", - "\n", - " contrast_xtick_labels.append(\n", - " \"{}\\nminus\\n{}\".format(current_group, current_control)\n", + " markersize=es_marker_size,\n", " )\n", + " \n", + " if show_baseline_ec:\n", + " _ = plot_effect_size(tick, bec_group, bec_control, bec_bootstrap, \n", + " bec_effsize, bec_ci_low, bec_ci_high)\n", + " # Baseline Curve don't need ticks text\n", + " \n", " return current_group, current_control, current_effsize, contrast_xtick_labels\n", "\n", "\n", diff --git a/nbs/API/plotter.ipynb b/nbs/API/plotter.ipynb index b0215d3c..2c2bfec7 100644 --- a/nbs/API/plotter.ipynb +++ b/nbs/API/plotter.ipynb @@ -118,6 +118,7 @@ " contrast_bars=True, contrast_bars_kwargs=None,\n", " delta_text=True, delta_text_kwargs=None,\n", " delta_dot=True, delta_dot_kwargs=None,\n", + " show_baseline_ec=False,\n", " \"\"\"\n", " from .misc_tools import (\n", " get_params,\n", @@ -168,9 +169,9 @@ " ytick_color = plt.rcParams[\"ytick.color\"]\n", "\n", " # Extract parameters and set kwargs\n", - " (dabest_obj, plot_data, xvar, yvar, is_paired, effect_size, \n", - " proportional, all_plot_groups, idx, show_delta2, show_mini_meta, \n", - " float_contrast, show_pairs, effect_size_type, group_summaries, err_color) = get_params(\n", + " (dabest_obj, plot_data, xvar, yvar, is_paired, effect_size, proportional,\n", + " all_plot_groups, idx, show_delta2, show_mini_meta, float_contrast,\n", + " show_pairs, effect_size_type, group_summaries, err_color, show_baseline_ec) = get_params(\n", " effectsize_df=effectsize_df, \n", " plot_kwargs=plot_kwargs\n", " )\n", @@ -389,7 +390,7 @@ " # Plot effect sizes and bootstraps.\n", " plot_groups = temp_all_plot_groups if (is_paired == \"baseline\" and show_pairs and two_col_sankey) else temp_idx if (two_col_sankey) else all_plot_groups\n", "\n", - " (ticks_to_skip, ticks_to_plot, \n", + " (ticks_to_skip, ticks_to_plot, ticks_for_baseline_ec,\n", " ticks_to_skip_contrast, ticks_to_start_twocol_sankey) = extract_contrast_plotting_ticks(\n", " is_paired=is_paired, \n", " show_pairs=show_pairs, \n", @@ -406,9 +407,10 @@ "\n", " results = effectsize_df.results\n", "\n", - " (current_group, current_control, \n", + " (current_group, current_control,\n", " current_effsize, contrast_xtick_labels) = effect_size_curve_plotter(\n", " ticks_to_plot=ticks_to_plot, \n", + " ticks_for_baseline_ec=ticks_for_baseline_ec,\n", " results=results, \n", " ci_type=ci_type, \n", " contrast_axes=contrast_axes, \n", @@ -419,6 +421,7 @@ " group_summary_kwargs=group_summary_kwargs, \n", " bootstraps_color_by_group=bootstraps_color_by_group,\n", " plot_palette_contrast=plot_palette_contrast,\n", + " show_baseline_ec=show_baseline_ec,\n", " )\n", "\n", " # Plot mini-meta violin\n", diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_05_cummings_two_group_unpaired_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_05_cummings_two_group_unpaired_meandiff.png index 47bcf864..895782b9 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_05_cummings_two_group_unpaired_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_05_cummings_two_group_unpaired_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_06_cummings_two_group_paired_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_06_cummings_two_group_paired_meandiff.png index d8c15a9d..2c172249 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_06_cummings_two_group_paired_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_06_cummings_two_group_paired_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_07_cummings_multi_group_unpaired.png b/nbs/tests/mpl_image_tests/baseline_images/test_07_cummings_multi_group_unpaired.png index c32e34bd..5dabd6ba 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_07_cummings_multi_group_unpaired.png and b/nbs/tests/mpl_image_tests/baseline_images/test_07_cummings_multi_group_unpaired.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_08_cummings_multi_group_paired.png b/nbs/tests/mpl_image_tests/baseline_images/test_08_cummings_multi_group_paired.png index 86fff480..5416a604 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_08_cummings_multi_group_paired.png and b/nbs/tests/mpl_image_tests/baseline_images/test_08_cummings_multi_group_paired.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_09_cummings_shared_control.png b/nbs/tests/mpl_image_tests/baseline_images/test_09_cummings_shared_control.png index 99a6e2aa..42484152 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_09_cummings_shared_control.png and b/nbs/tests/mpl_image_tests/baseline_images/test_09_cummings_shared_control.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_103_cummings_two_group_unpaired_propdiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_103_cummings_two_group_unpaired_propdiff.png index 260147a4..4fdd936a 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_103_cummings_two_group_unpaired_propdiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_103_cummings_two_group_unpaired_propdiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_105_cummings_multi_group_unpaired_propdiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_105_cummings_multi_group_unpaired_propdiff.png index 9b1454b2..392abb53 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_105_cummings_multi_group_unpaired_propdiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_105_cummings_multi_group_unpaired_propdiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_106_cummings_shared_control_propdiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_106_cummings_shared_control_propdiff.png index 83f578ce..59d7ab71 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_106_cummings_shared_control_propdiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_106_cummings_shared_control_propdiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_107_cummings_multi_groups_propdiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_107_cummings_multi_groups_propdiff.png index 5df112c6..606257de 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_107_cummings_multi_groups_propdiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_107_cummings_multi_groups_propdiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_10_cummings_multi_groups.png b/nbs/tests/mpl_image_tests/baseline_images/test_10_cummings_multi_groups.png index c485546e..751a187f 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_10_cummings_multi_groups.png and b/nbs/tests/mpl_image_tests/baseline_images/test_10_cummings_multi_groups.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_111_change_palette_b.png b/nbs/tests/mpl_image_tests/baseline_images/test_111_change_palette_b.png index 2eabd427..b73a9128 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_111_change_palette_b.png and b/nbs/tests/mpl_image_tests/baseline_images/test_111_change_palette_b.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_112_change_palette_c.png b/nbs/tests/mpl_image_tests/baseline_images/test_112_change_palette_c.png index 2e0d86e0..bbedf6e9 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_112_change_palette_c.png and b/nbs/tests/mpl_image_tests/baseline_images/test_112_change_palette_c.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_113_desat.png b/nbs/tests/mpl_image_tests/baseline_images/test_113_desat.png index 94f9747c..eb015140 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_113_desat.png and b/nbs/tests/mpl_image_tests/baseline_images/test_113_desat.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_114_change_ylims.png b/nbs/tests/mpl_image_tests/baseline_images/test_114_change_ylims.png index 46131938..9ccb46fe 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_114_change_ylims.png and b/nbs/tests/mpl_image_tests/baseline_images/test_114_change_ylims.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_115_invert_ylim.png b/nbs/tests/mpl_image_tests/baseline_images/test_115_invert_ylim.png index 5025e477..33a9c89a 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_115_invert_ylim.png and b/nbs/tests/mpl_image_tests/baseline_images/test_115_invert_ylim.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_118_cummings_two_group_unpaired_meandiff_bar_width.png b/nbs/tests/mpl_image_tests/baseline_images/test_118_cummings_two_group_unpaired_meandiff_bar_width.png index 5d0b3938..edad4e3c 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_118_cummings_two_group_unpaired_meandiff_bar_width.png and b/nbs/tests/mpl_image_tests/baseline_images/test_118_cummings_two_group_unpaired_meandiff_bar_width.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_119_wide_df_nan.png b/nbs/tests/mpl_image_tests/baseline_images/test_119_wide_df_nan.png index 2880dd45..cd00b86d 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_119_wide_df_nan.png and b/nbs/tests/mpl_image_tests/baseline_images/test_119_wide_df_nan.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_11_inset_plots.png b/nbs/tests/mpl_image_tests/baseline_images/test_11_inset_plots.png index 3e0fbadd..28a2bcd1 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_11_inset_plots.png and b/nbs/tests/mpl_image_tests/baseline_images/test_11_inset_plots.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_120_long_df_nan.png b/nbs/tests/mpl_image_tests/baseline_images/test_120_long_df_nan.png index 2880dd45..cd00b86d 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_120_long_df_nan.png and b/nbs/tests/mpl_image_tests/baseline_images/test_120_long_df_nan.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_122_cohens_h_cummings.png b/nbs/tests/mpl_image_tests/baseline_images/test_122_cohens_h_cummings.png index 61d934c9..c6f347da 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_122_cohens_h_cummings.png and b/nbs/tests/mpl_image_tests/baseline_images/test_122_cohens_h_cummings.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_123_sankey_gardner_altman.png b/nbs/tests/mpl_image_tests/baseline_images/test_123_sankey_gardner_altman.png index d7db7ea2..52d6eee3 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_123_sankey_gardner_altman.png and b/nbs/tests/mpl_image_tests/baseline_images/test_123_sankey_gardner_altman.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_124_sankey_cummings.png b/nbs/tests/mpl_image_tests/baseline_images/test_124_sankey_cummings.png index 6014c7ad..b23dd51e 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_124_sankey_cummings.png and b/nbs/tests/mpl_image_tests/baseline_images/test_124_sankey_cummings.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_125_sankey_2paired_groups.png b/nbs/tests/mpl_image_tests/baseline_images/test_125_sankey_2paired_groups.png index e6cc78d7..1820a124 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_125_sankey_2paired_groups.png and b/nbs/tests/mpl_image_tests/baseline_images/test_125_sankey_2paired_groups.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_126_sankey_2sequential_groups.png b/nbs/tests/mpl_image_tests/baseline_images/test_126_sankey_2sequential_groups.png index e6cc78d7..1820a124 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_126_sankey_2sequential_groups.png and b/nbs/tests/mpl_image_tests/baseline_images/test_126_sankey_2sequential_groups.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_127_sankey_multi_group_paired.png b/nbs/tests/mpl_image_tests/baseline_images/test_127_sankey_multi_group_paired.png index 097c8668..e4c7e8c2 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_127_sankey_multi_group_paired.png and b/nbs/tests/mpl_image_tests/baseline_images/test_127_sankey_multi_group_paired.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_128_sankey_transparency.png b/nbs/tests/mpl_image_tests/baseline_images/test_128_sankey_transparency.png index 334b045f..83c2c9ae 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_128_sankey_transparency.png and b/nbs/tests/mpl_image_tests/baseline_images/test_128_sankey_transparency.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_129_zero_to_zero.png b/nbs/tests/mpl_image_tests/baseline_images/test_129_zero_to_zero.png index 279bc74b..a2e0fb8b 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_129_zero_to_zero.png and b/nbs/tests/mpl_image_tests/baseline_images/test_129_zero_to_zero.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_130_zero_to_one.png b/nbs/tests/mpl_image_tests/baseline_images/test_130_zero_to_one.png index da88d890..b60c123e 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_130_zero_to_one.png and b/nbs/tests/mpl_image_tests/baseline_images/test_130_zero_to_one.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_131_one_to_zero.png b/nbs/tests/mpl_image_tests/baseline_images/test_131_one_to_zero.png index a17263f3..2cab2eca 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_131_one_to_zero.png and b/nbs/tests/mpl_image_tests/baseline_images/test_131_one_to_zero.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_132_shared_control_sankey_off.png b/nbs/tests/mpl_image_tests/baseline_images/test_132_shared_control_sankey_off.png index 94f850d6..7a4aeec3 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_132_shared_control_sankey_off.png and b/nbs/tests/mpl_image_tests/baseline_images/test_132_shared_control_sankey_off.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_134_separate_control_sankey_off.png b/nbs/tests/mpl_image_tests/baseline_images/test_134_separate_control_sankey_off.png index c0036635..9609f767 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_134_separate_control_sankey_off.png and b/nbs/tests/mpl_image_tests/baseline_images/test_134_separate_control_sankey_off.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_136_style_sheets.png b/nbs/tests/mpl_image_tests/baseline_images/test_136_style_sheets.png index 93475edd..54e02859 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_136_style_sheets.png and b/nbs/tests/mpl_image_tests/baseline_images/test_136_style_sheets.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_13_multi_2group_color.png b/nbs/tests/mpl_image_tests/baseline_images/test_13_multi_2group_color.png index f146a6a8..6ed27f79 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_13_multi_2group_color.png and b/nbs/tests/mpl_image_tests/baseline_images/test_13_multi_2group_color.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_15_change_palette_a.png b/nbs/tests/mpl_image_tests/baseline_images/test_15_change_palette_a.png index 1a1320e5..da2bc0d1 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_15_change_palette_a.png and b/nbs/tests/mpl_image_tests/baseline_images/test_15_change_palette_a.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_16_change_palette_b.png b/nbs/tests/mpl_image_tests/baseline_images/test_16_change_palette_b.png index c1e4ae2e..aa4fc957 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_16_change_palette_b.png and b/nbs/tests/mpl_image_tests/baseline_images/test_16_change_palette_b.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_17_change_palette_c.png b/nbs/tests/mpl_image_tests/baseline_images/test_17_change_palette_c.png index f04b0dc9..c448fc55 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_17_change_palette_c.png and b/nbs/tests/mpl_image_tests/baseline_images/test_17_change_palette_c.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_18_desat.png b/nbs/tests/mpl_image_tests/baseline_images/test_18_desat.png index 53095da8..fa571711 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_18_desat.png and b/nbs/tests/mpl_image_tests/baseline_images/test_18_desat.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_19_dot_sizes.png b/nbs/tests/mpl_image_tests/baseline_images/test_19_dot_sizes.png index eed9a9b3..8eaf98df 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_19_dot_sizes.png and b/nbs/tests/mpl_image_tests/baseline_images/test_19_dot_sizes.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_208_cummings_two_group_unpaired_meandiff_empty_circle.png b/nbs/tests/mpl_image_tests/baseline_images/test_208_cummings_two_group_unpaired_meandiff_empty_circle.png index ea024cc7..1cc00350 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_208_cummings_two_group_unpaired_meandiff_empty_circle.png and b/nbs/tests/mpl_image_tests/baseline_images/test_208_cummings_two_group_unpaired_meandiff_empty_circle.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_209_cummings_shared_control_meandiff_empty_circle.png b/nbs/tests/mpl_image_tests/baseline_images/test_209_cummings_shared_control_meandiff_empty_circle.png index ec1d2919..2e975cf8 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_209_cummings_shared_control_meandiff_empty_circle.png and b/nbs/tests/mpl_image_tests/baseline_images/test_209_cummings_shared_control_meandiff_empty_circle.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_20_change_ylims.png b/nbs/tests/mpl_image_tests/baseline_images/test_20_change_ylims.png index 5f5b42c3..d43d7033 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_20_change_ylims.png and b/nbs/tests/mpl_image_tests/baseline_images/test_20_change_ylims.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_210_cummings_multi_groups_meandiff_empty_circle.png b/nbs/tests/mpl_image_tests/baseline_images/test_210_cummings_multi_groups_meandiff_empty_circle.png index d682eb97..24bf0b02 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_210_cummings_multi_groups_meandiff_empty_circle.png and b/nbs/tests/mpl_image_tests/baseline_images/test_210_cummings_multi_groups_meandiff_empty_circle.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_211_cummings_multi_2_group_meandiff_empty_circle.png b/nbs/tests/mpl_image_tests/baseline_images/test_211_cummings_multi_2_group_meandiff_empty_circle.png index 6c667f38..76967000 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_211_cummings_multi_2_group_meandiff_empty_circle.png and b/nbs/tests/mpl_image_tests/baseline_images/test_211_cummings_multi_2_group_meandiff_empty_circle.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_212_cummings_unpaired_delta_delta_meandiff_empty_circle.png b/nbs/tests/mpl_image_tests/baseline_images/test_212_cummings_unpaired_delta_delta_meandiff_empty_circle.png index 21667363..cd688658 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_212_cummings_unpaired_delta_delta_meandiff_empty_circle.png and b/nbs/tests/mpl_image_tests/baseline_images/test_212_cummings_unpaired_delta_delta_meandiff_empty_circle.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_213_cummings_unpaired_mini_meta_meandiff_empty_circle.png b/nbs/tests/mpl_image_tests/baseline_images/test_213_cummings_unpaired_mini_meta_meandiff_empty_circle.png index f34d9b4b..ae0484d8 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_213_cummings_unpaired_mini_meta_meandiff_empty_circle.png and b/nbs/tests/mpl_image_tests/baseline_images/test_213_cummings_unpaired_mini_meta_meandiff_empty_circle.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_214_change_idx_order_custom_palette_original.png b/nbs/tests/mpl_image_tests/baseline_images/test_214_change_idx_order_custom_palette_original.png index 72a00bfa..976ab458 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_214_change_idx_order_custom_palette_original.png and b/nbs/tests/mpl_image_tests/baseline_images/test_214_change_idx_order_custom_palette_original.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_215_change_idx_order_custom_palette_new.png b/nbs/tests/mpl_image_tests/baseline_images/test_215_change_idx_order_custom_palette_new.png index 41fad519..65ff816a 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_215_change_idx_order_custom_palette_new.png and b/nbs/tests/mpl_image_tests/baseline_images/test_215_change_idx_order_custom_palette_new.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_216_cummings_multi_groups_meandiff_show_baseline_ec.png b/nbs/tests/mpl_image_tests/baseline_images/test_216_cummings_multi_groups_meandiff_show_baseline_ec.png new file mode 100644 index 00000000..b5824a18 Binary files /dev/null and b/nbs/tests/mpl_image_tests/baseline_images/test_216_cummings_multi_groups_meandiff_show_baseline_ec.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_217_cummings_multi_2_group_meandiff_show_baseline_ec.png b/nbs/tests/mpl_image_tests/baseline_images/test_217_cummings_multi_2_group_meandiff_show_baseline_ec.png new file mode 100644 index 00000000..b4bf63c4 Binary files /dev/null and b/nbs/tests/mpl_image_tests/baseline_images/test_217_cummings_multi_2_group_meandiff_show_baseline_ec.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_21_invert_ylim.png b/nbs/tests/mpl_image_tests/baseline_images/test_21_invert_ylim.png index 6a91213b..2379d990 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_21_invert_ylim.png and b/nbs/tests/mpl_image_tests/baseline_images/test_21_invert_ylim.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_23_ticker_cumming.png b/nbs/tests/mpl_image_tests/baseline_images/test_23_ticker_cumming.png index a74d8fb2..0a9db591 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_23_ticker_cumming.png and b/nbs/tests/mpl_image_tests/baseline_images/test_23_ticker_cumming.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_24_wide_df_nan.png b/nbs/tests/mpl_image_tests/baseline_images/test_24_wide_df_nan.png index 577fa498..1350981c 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_24_wide_df_nan.png and b/nbs/tests/mpl_image_tests/baseline_images/test_24_wide_df_nan.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_25_long_df_nan.png b/nbs/tests/mpl_image_tests/baseline_images/test_25_long_df_nan.png index 577fa498..1350981c 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_25_long_df_nan.png and b/nbs/tests/mpl_image_tests/baseline_images/test_25_long_df_nan.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_28_unpaired_cumming_reflines_kwargs.png b/nbs/tests/mpl_image_tests/baseline_images/test_28_unpaired_cumming_reflines_kwargs.png index 61c7507a..038bbf35 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_28_unpaired_cumming_reflines_kwargs.png and b/nbs/tests/mpl_image_tests/baseline_images/test_28_unpaired_cumming_reflines_kwargs.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_29_paired_cumming_slopegraph_reflines_kwargs.png b/nbs/tests/mpl_image_tests/baseline_images/test_29_paired_cumming_slopegraph_reflines_kwargs.png index ea4b426d..f9177fa2 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_29_paired_cumming_slopegraph_reflines_kwargs.png and b/nbs/tests/mpl_image_tests/baseline_images/test_29_paired_cumming_slopegraph_reflines_kwargs.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_30_sequential_cumming_slopegraph.png b/nbs/tests/mpl_image_tests/baseline_images/test_30_sequential_cumming_slopegraph.png index 6975e1c5..b42f20e8 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_30_sequential_cumming_slopegraph.png and b/nbs/tests/mpl_image_tests/baseline_images/test_30_sequential_cumming_slopegraph.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_31_baseline_cumming_slopegraph.png b/nbs/tests/mpl_image_tests/baseline_images/test_31_baseline_cumming_slopegraph.png index 893ca46e..512e3038 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_31_baseline_cumming_slopegraph.png and b/nbs/tests/mpl_image_tests/baseline_images/test_31_baseline_cumming_slopegraph.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_47_cummings_unpaired_delta_delta_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_47_cummings_unpaired_delta_delta_meandiff.png index d2cf430d..300f43ca 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_47_cummings_unpaired_delta_delta_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_47_cummings_unpaired_delta_delta_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_48_cummings_sequential_delta_delta_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_48_cummings_sequential_delta_delta_meandiff.png index 824dff19..a9384f01 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_48_cummings_sequential_delta_delta_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_48_cummings_sequential_delta_delta_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_49_cummings_baseline_delta_delta_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_49_cummings_baseline_delta_delta_meandiff.png index 824dff19..a9384f01 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_49_cummings_baseline_delta_delta_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_49_cummings_baseline_delta_delta_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_50_delta_plot_ylabel.png b/nbs/tests/mpl_image_tests/baseline_images/test_50_delta_plot_ylabel.png index 6ef6fc16..f64a02db 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_50_delta_plot_ylabel.png and b/nbs/tests/mpl_image_tests/baseline_images/test_50_delta_plot_ylabel.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_51_delta_plot_change_palette_a.png b/nbs/tests/mpl_image_tests/baseline_images/test_51_delta_plot_change_palette_a.png index ea4adfc4..2bb76b44 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_51_delta_plot_change_palette_a.png and b/nbs/tests/mpl_image_tests/baseline_images/test_51_delta_plot_change_palette_a.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_52_delta_specified.png b/nbs/tests/mpl_image_tests/baseline_images/test_52_delta_specified.png index ed3432ef..89b23a8d 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_52_delta_specified.png and b/nbs/tests/mpl_image_tests/baseline_images/test_52_delta_specified.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_53_delta_change_ylims.png b/nbs/tests/mpl_image_tests/baseline_images/test_53_delta_change_ylims.png index 794a0548..a188c8ad 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_53_delta_change_ylims.png and b/nbs/tests/mpl_image_tests/baseline_images/test_53_delta_change_ylims.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_54_delta_invert_ylim.png b/nbs/tests/mpl_image_tests/baseline_images/test_54_delta_invert_ylim.png index ef63c04d..ebccec26 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_54_delta_invert_ylim.png and b/nbs/tests/mpl_image_tests/baseline_images/test_54_delta_invert_ylim.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_55_delta_median_diff.png b/nbs/tests/mpl_image_tests/baseline_images/test_55_delta_median_diff.png index 2bf942a6..0195fbad 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_55_delta_median_diff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_55_delta_median_diff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_56_delta_cohens_d.png b/nbs/tests/mpl_image_tests/baseline_images/test_56_delta_cohens_d.png index 3cb8a185..37a1fb10 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_56_delta_cohens_d.png and b/nbs/tests/mpl_image_tests/baseline_images/test_56_delta_cohens_d.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_57_delta_show_delta2.png b/nbs/tests/mpl_image_tests/baseline_images/test_57_delta_show_delta2.png index d04fa036..6d88ef90 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_57_delta_show_delta2.png and b/nbs/tests/mpl_image_tests/baseline_images/test_57_delta_show_delta2.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_58_delta_axes_invert_ylim.png b/nbs/tests/mpl_image_tests/baseline_images/test_58_delta_axes_invert_ylim.png index 8bd09757..d15b1724 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_58_delta_axes_invert_ylim.png and b/nbs/tests/mpl_image_tests/baseline_images/test_58_delta_axes_invert_ylim.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_59_delta_axes_invert_ylim_not_showing_delta2.png b/nbs/tests/mpl_image_tests/baseline_images/test_59_delta_axes_invert_ylim_not_showing_delta2.png index d04fa036..6d88ef90 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_59_delta_axes_invert_ylim_not_showing_delta2.png and b/nbs/tests/mpl_image_tests/baseline_images/test_59_delta_axes_invert_ylim_not_showing_delta2.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_60_cummings_unpaired_mini_meta_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_60_cummings_unpaired_mini_meta_meandiff.png index cb2356ad..c3cd87bb 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_60_cummings_unpaired_mini_meta_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_60_cummings_unpaired_mini_meta_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_61_cummings_sequential_mini_meta_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_61_cummings_sequential_mini_meta_meandiff.png index da3a9580..678c6462 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_61_cummings_sequential_mini_meta_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_61_cummings_sequential_mini_meta_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_62_cummings_baseline_mini_meta_meandiff.png b/nbs/tests/mpl_image_tests/baseline_images/test_62_cummings_baseline_mini_meta_meandiff.png index da3a9580..678c6462 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_62_cummings_baseline_mini_meta_meandiff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_62_cummings_baseline_mini_meta_meandiff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_63_mini_meta_plot_ylabel.png b/nbs/tests/mpl_image_tests/baseline_images/test_63_mini_meta_plot_ylabel.png index 09edd730..f0a2ef78 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_63_mini_meta_plot_ylabel.png and b/nbs/tests/mpl_image_tests/baseline_images/test_63_mini_meta_plot_ylabel.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_64_mini_meta_plot_change_palette_a.png b/nbs/tests/mpl_image_tests/baseline_images/test_64_mini_meta_plot_change_palette_a.png index b9975211..7a7013b6 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_64_mini_meta_plot_change_palette_a.png and b/nbs/tests/mpl_image_tests/baseline_images/test_64_mini_meta_plot_change_palette_a.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_65_mini_meta_dot_sizes.png b/nbs/tests/mpl_image_tests/baseline_images/test_65_mini_meta_dot_sizes.png index a713453e..38fa293c 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_65_mini_meta_dot_sizes.png and b/nbs/tests/mpl_image_tests/baseline_images/test_65_mini_meta_dot_sizes.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_66_mini_meta_change_ylims.png b/nbs/tests/mpl_image_tests/baseline_images/test_66_mini_meta_change_ylims.png index 7fba8be7..de122d50 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_66_mini_meta_change_ylims.png and b/nbs/tests/mpl_image_tests/baseline_images/test_66_mini_meta_change_ylims.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_67_mini_meta_invert_ylim.png b/nbs/tests/mpl_image_tests/baseline_images/test_67_mini_meta_invert_ylim.png index 9ff26211..afd67c8d 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_67_mini_meta_invert_ylim.png and b/nbs/tests/mpl_image_tests/baseline_images/test_67_mini_meta_invert_ylim.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_68_mini_meta_median_diff.png b/nbs/tests/mpl_image_tests/baseline_images/test_68_mini_meta_median_diff.png index d1bc094b..9808f220 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_68_mini_meta_median_diff.png and b/nbs/tests/mpl_image_tests/baseline_images/test_68_mini_meta_median_diff.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_69_mini_meta_cohens_d.png b/nbs/tests/mpl_image_tests/baseline_images/test_69_mini_meta_cohens_d.png index 7eeb64e6..f3c1d761 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_69_mini_meta_cohens_d.png and b/nbs/tests/mpl_image_tests/baseline_images/test_69_mini_meta_cohens_d.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_70_mini_meta_not_show.png b/nbs/tests/mpl_image_tests/baseline_images/test_70_mini_meta_not_show.png index 49f75004..3c881c1c 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_70_mini_meta_not_show.png and b/nbs/tests/mpl_image_tests/baseline_images/test_70_mini_meta_not_show.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_71_unpaired_delta_g.png b/nbs/tests/mpl_image_tests/baseline_images/test_71_unpaired_delta_g.png index b9d3dda7..20c75b9c 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_71_unpaired_delta_g.png and b/nbs/tests/mpl_image_tests/baseline_images/test_71_unpaired_delta_g.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_72_sequential_delta_g.png b/nbs/tests/mpl_image_tests/baseline_images/test_72_sequential_delta_g.png index 824dff19..a9384f01 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_72_sequential_delta_g.png and b/nbs/tests/mpl_image_tests/baseline_images/test_72_sequential_delta_g.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_73_baseline_delta_g.png b/nbs/tests/mpl_image_tests/baseline_images/test_73_baseline_delta_g.png index 824dff19..a9384f01 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_73_baseline_delta_g.png and b/nbs/tests/mpl_image_tests/baseline_images/test_73_baseline_delta_g.png differ diff --git a/nbs/tests/mpl_image_tests/baseline_images/test_99_style_sheets.png b/nbs/tests/mpl_image_tests/baseline_images/test_99_style_sheets.png index 112f96aa..2be2ffe5 100644 Binary files a/nbs/tests/mpl_image_tests/baseline_images/test_99_style_sheets.png and b/nbs/tests/mpl_image_tests/baseline_images/test_99_style_sheets.png differ diff --git a/nbs/tests/mpl_image_tests/test_plot_aesthetics.py b/nbs/tests/mpl_image_tests/test_plot_aesthetics.py index bea92cce..6d362d6f 100644 --- a/nbs/tests/mpl_image_tests/test_plot_aesthetics.py +++ b/nbs/tests/mpl_image_tests/test_plot_aesthetics.py @@ -208,3 +208,11 @@ def test_214_change_idx_order_custom_palette_original(): @pytest.mark.mpl_image_compare(tolerance=8) def test_215_change_idx_order_custom_palette_new(): return multi_groups_change_idx_new.mean_diff.plot(custom_palette=palette); + +@pytest.mark.mpl_image_compare(tolerance=8) +def test_216_cummings_multi_groups_meandiff_show_baseline_ec(): + return multi_groups.mean_diff.plot(show_baseline_ec=True); + +@pytest.mark.mpl_image_compare(tolerance=8) +def test_217_cummings_multi_2_group_meandiff_show_baseline_ec(): + return multi_2group.mean_diff.plot(show_baseline_ec=True); \ No newline at end of file