multi

MultiContrast Class

The MultiContrast class enables visualization of multiple contrast objects in grid-based layouts.


source

MultiContrast

def MultiContrast(
    dabest_objs:Union, # Raw dabest objects. Can be:
    # - 1D: [dabest_obj1, dabest_obj2, ...]  
    # - 2D: [[dabest_obj1, dabest_obj2], [dabest_obj3, dabest_obj4]]
    labels:Optional=None, # Labels matching the contrast array structure. If None, defaults will be generated.
    row_labels:Optional=None, effect_size:str='mean_diff', # Effect size to extract from dabest objects
    ci_type:str='bca', # Confidence interval type
):

Unified multiple contrast object for forest plots and whorlmaps.

Takes raw dabest objects and provides validated, processed data for downstream visualizations.

Loading Function


source

combine

def combine(
    dabest_objs:Union, # Raw dabest objects in 1D or 2D structure
    labels:Optional=None, # Labels for dabest_objs
    row_labels:Optional=None, effect_size:str='mean_diff', # Effect size to extract
    ci_type:str='bca', # Confidence interval type
    allow_mixed_types:bool=False, # If True, allows different contrast types in different rows (whorlmap only)
    # If False, enforces homogeneous types (forest_plot compatible)
)->MultiContrast: # Validated multi-contrast object ready for visualization

Create a MultiContrast object from raw dabest objects.

This is the main entry point that users should use to create multi-contrast visualizations.

Whorlmap Visualization

The whorlmap creates spiral heatmaps showing the distribution of bootstrap samples for each contrast.


source

whorlmap

def whorlmap(
    multi_contrast, # Object containing multiple dabest objects
    n:int=21, # Size of each spiral (n x n grid per contrast)
    sort_by:NoneType=None, # Order to sort contrasts by
    cmap:str='vlag', vmax:NoneType=None, vmin:NoneType=None,
    reverse_neg:bool=True, # Whether to reverse negative values
    abs_rank:bool=False, # Whether to rank by absolute value
    chop_tail:int=0, # Percentage of extreme values to exclude
    ax:NoneType=None, # Existing axes to plot on
    fig_size:NoneType=None, # Figure size (width, height) in inches
    title:NoneType=None, # Plot title
    heatmap_kwargs:NoneType=None, # Additional keyword arguments passed to sns.heatmap().
    # Common options include:
    # - 'cmap': colormap (overrides direct cmap parameter)
    # - 'vmin', 'vmax': color scale limits (override direct parameters)
    # - 'center': center value for colormap
    # - 'annot': whether to annotate cells with values
    # - 'fmt': format string for annotations
    # - 'linewidths': width of lines between cells
    # - 'linecolor': color of lines between cells
    # - 'cbar': whether to show colorbar
    # - 'cbar_kws': colorbar customization dict
    # - 'square': whether to make cells square
    # - 'xticklabels', 'yticklabels': tick label control
    # - 'mask': boolean array to mask cells
    plot_kwargs:NoneType=None, # Additional keyword arguments for plot styling and layout.
    # Available options (WIP):
    # - 'title': plot title
    # - 'xlabel', 'ylabel': axis labels
    # - 'xticklabels', 'yticklabels': tick labels
    # - 'xticklabels_rotation', 'yticklabels_rotation': tick label rotation angles
    # - 'xticklabels_ha', 'yticklabels_ha': horizontal alignment 
):

Create a whorlmap visualization of multiple contrasts.