@@ -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 ()
@@ -183,7 +184,8 @@ def __init__(self, data, idx, x, y, paired, id_col, ci, resamples,
183184
184185 EffectSizeDataFrame_kwargs = dict (ci = ci , is_paired = paired ,
185186 random_seed = random_seed ,
186- resamples = resamples )
187+ resamples = resamples ,
188+ proportional = proportional )
187189
188190 self .__mean_diff = EffectSizeDataFrame (self , "mean_diff" ,
189191 ** EffectSizeDataFrame_kwargs )
@@ -535,6 +537,15 @@ def _plot_data(self):
535537 """
536538 return self .__plot_data
537539
540+
541+ @property
542+ def proportional (self ):
543+ """
544+ Returns the proportional parameter
545+ class.
546+ """
547+ return self .__proportional
548+
538549 @property
539550 def _all_plot_groups (self ):
540551 """
@@ -546,7 +557,6 @@ def _all_plot_groups(self):
546557
547558
548559
549-
550560class TwoGroupsEffectSize (object ):
551561
552562 """
@@ -1313,7 +1323,7 @@ class EffectSizeDataFrame(object):
13131323 sizes for several comparisons."""
13141324
13151325 def __init__ (self , dabest , effect_size ,
1316- is_paired , ci = 95 ,
1326+ is_paired , ci = 95 , proportional = False ,
13171327 resamples = 5000 ,
13181328 permutation_count = 5000 ,
13191329 random_seed = 12345 ):
@@ -1329,6 +1339,7 @@ def __init__(self, dabest, effect_size,
13291339 self .__resamples = resamples
13301340 self .__permutation_count = permutation_count
13311341 self .__random_seed = random_seed
1342+ self .__proportional = proportional
13321343
13331344
13341345 def __pre_calc (self ):
@@ -1501,10 +1512,10 @@ def plot(self, color_col=None,
15011512
15021513 raw_marker_size = 6 , es_marker_size = 9 ,
15031514
1504- swarm_label = None , contrast_label = None ,
1505- swarm_ylim = None , contrast_ylim = None ,
1515+ swarm_label = None , barchart_label = None , contrast_label = None ,
1516+ swarm_ylim = None , barchart_ylim = None , contrast_ylim = None ,
15061517
1507- custom_palette = None , swarm_desat = 0.5 , halfviolin_desat = 1 ,
1518+ custom_palette = None , swarm_desat = 0.5 , barchart_desat = 0.5 , halfviolin_desat = 1 ,
15081519 halfviolin_alpha = 0.8 ,
15091520
15101521 float_contrast = True ,
@@ -1516,6 +1527,8 @@ def plot(self, color_col=None,
15161527 dpi = 100 ,
15171528 ax = None ,
15181529
1530+
1531+ barchartplot_kwargs = None ,
15191532 swarmplot_kwargs = None ,
15201533 violinplot_kwargs = None ,
15211534 slopegraph_kwargs = None ,
@@ -1682,19 +1695,35 @@ def plot(self, color_col=None,
16821695
16831696 """
16841697
1685- from .plotter import EffectSizeDataFramePlotter
1698+ from .plotter import EffectSizeDataFramePlotter , ProportionalDataFramePlotter
1699+
16861700
16871701 if hasattr (self , "results" ) is False :
16881702 self .__pre_calc ()
16891703
1704+ if self .__proportional :
1705+ raw_marker_size = 0.01
1706+
16901707 all_kwargs = locals ()
16911708 del all_kwargs ["self" ]
16921709
1710+ if self .__proportional :
1711+ out = ProportionalDataFramePlotter (self , ** all_kwargs )
1712+ return out
1713+
16931714 out = EffectSizeDataFramePlotter (self , ** all_kwargs )
16941715
16951716 return out
16961717
16971718
1719+ @property
1720+ def proportional (self ):
1721+ """
1722+ Returns the proportional parameter
1723+ class.
1724+ """
1725+ return self .__proportional
1726+
16981727 @property
16991728 def results (self ):
17001729 """Prints all pairwise comparisons nicely."""
@@ -1780,7 +1809,14 @@ def dabest_obj(self):
17801809 class.
17811810 """
17821811 return self .__dabest_obj
1783-
1812+
1813+ @property
1814+ def proportional (self ):
1815+ """
1816+ Returns the proportional parameter
1817+ class.
1818+ """
1819+ return self .__proportional
17841820
17851821 @property
17861822 def lqrt (self ):
@@ -1795,6 +1831,7 @@ def lqrt(self):
17951831 self .__calc_lqrt ()
17961832 return self .__lqrt_results
17971833
1834+
17981835
17991836
18001837
0 commit comments