@@ -10,7 +10,7 @@ class Dabest(object):
1010 """
1111
1212 def __init__ (self , data , idx , x , y , paired , id_col , ci , resamples ,
13- random_seed ):
13+ random_seed , proportional ):
1414
1515 """
1616 Parses and stores pandas DataFrames in preparation for estimation
@@ -30,6 +30,7 @@ def __init__(self, data, idx, x, y, paired, id_col, ci, resamples,
3030 self .__is_paired = paired
3131 self .__resamples = resamples
3232 self .__random_seed = random_seed
33+ self .__proportional = proportional
3334
3435 # Make a copy of the data, so we don't make alterations to it.
3536 data_in = data .copy ()
@@ -198,7 +199,8 @@ def __init__(self, data, idx, x, y, paired, id_col, ci, resamples,
198199
199200 EffectSizeDataFrame_kwargs = dict (ci = ci , is_paired = paired ,
200201 random_seed = random_seed ,
201- resamples = resamples )
202+ resamples = resamples ,
203+ proportional = proportional )
202204
203205 self .__mean_diff = EffectSizeDataFrame (self , "mean_diff" ,
204206 ** EffectSizeDataFrame_kwargs )
@@ -588,6 +590,15 @@ def _plot_data(self):
588590 """
589591 return self .__plot_data
590592
593+
594+ @property
595+ def proportional (self ):
596+ """
597+ Returns the proportional parameter
598+ class.
599+ """
600+ return self .__proportional
601+
591602 @property
592603 def _all_plot_groups (self ):
593604 """
@@ -599,7 +610,6 @@ def _all_plot_groups(self):
599610
600611
601612
602-
603613class TwoGroupsEffectSize (object ):
604614
605615 """
@@ -1375,7 +1385,7 @@ class EffectSizeDataFrame(object):
13751385 sizes for several comparisons."""
13761386
13771387 def __init__ (self , dabest , effect_size ,
1378- is_paired , ci = 95 ,
1388+ is_paired , ci = 95 , proportional = False ,
13791389 resamples = 5000 ,
13801390 permutation_count = 5000 ,
13811391 random_seed = 12345 ):
@@ -1391,6 +1401,7 @@ def __init__(self, dabest, effect_size,
13911401 self .__resamples = resamples
13921402 self .__permutation_count = permutation_count
13931403 self .__random_seed = random_seed
1404+ self .__proportional = proportional
13941405
13951406
13961407 def __pre_calc (self ):
@@ -1570,10 +1581,10 @@ def plot(self, color_col=None,
15701581
15711582 raw_marker_size = 6 , es_marker_size = 9 ,
15721583
1573- swarm_label = None , contrast_label = None ,
1574- swarm_ylim = None , contrast_ylim = None ,
1584+ swarm_label = None , barchart_label = None , contrast_label = None ,
1585+ swarm_ylim = None , barchart_ylim = None , contrast_ylim = None ,
15751586
1576- custom_palette = None , swarm_desat = 0.5 , halfviolin_desat = 1 ,
1587+ custom_palette = None , swarm_desat = 0.5 , barchart_desat = 0.5 , halfviolin_desat = 1 ,
15771588 halfviolin_alpha = 0.8 ,
15781589
15791590 float_contrast = True ,
@@ -1585,6 +1596,8 @@ def plot(self, color_col=None,
15851596 dpi = 100 ,
15861597 ax = None ,
15871598
1599+
1600+ barchartplot_kwargs = None ,
15881601 swarmplot_kwargs = None ,
15891602 violinplot_kwargs = None ,
15901603 slopegraph_kwargs = None ,
@@ -1765,19 +1778,35 @@ def plot(self, color_col=None,
17651778
17661779 """
17671780
1768- from .plotter import EffectSizeDataFramePlotter
1781+ from .plotter import EffectSizeDataFramePlotter , ProportionalDataFramePlotter
1782+
17691783
17701784 if hasattr (self , "results" ) is False :
17711785 self .__pre_calc ()
17721786
1787+ if self .__proportional :
1788+ raw_marker_size = 0.01
1789+
17731790 all_kwargs = locals ()
17741791 del all_kwargs ["self" ]
17751792
1793+ if self .__proportional :
1794+ out = ProportionalDataFramePlotter (self , ** all_kwargs )
1795+ return out
1796+
17761797 out = EffectSizeDataFramePlotter (self , ** all_kwargs )
17771798
17781799 return out
17791800
17801801
1802+ @property
1803+ def proportional (self ):
1804+ """
1805+ Returns the proportional parameter
1806+ class.
1807+ """
1808+ return self .__proportional
1809+
17811810 @property
17821811 def results (self ):
17831812 """Prints all pairwise comparisons nicely."""
@@ -1863,7 +1892,14 @@ def dabest_obj(self):
18631892 class.
18641893 """
18651894 return self .__dabest_obj
1866-
1895+
1896+ @property
1897+ def proportional (self ):
1898+ """
1899+ Returns the proportional parameter
1900+ class.
1901+ """
1902+ return self .__proportional
18671903
18681904 @property
18691905 def lqrt (self ):
@@ -1878,6 +1914,7 @@ def lqrt(self):
18781914 self .__calc_lqrt ()
18791915 return self .__lqrt_results
18801916
1917+
18811918
18821919
18831920
0 commit comments