Skip to content

Commit 4616f79

Browse files
committed
Adjusted default figure size for paired twogroup non proportional float_contrast plots (increase width a bit)
1 parent 2195681 commit 4616f79

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

dabest/misc_tools.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,8 @@ def initialize_fig(
685685
effect_size_type: str,
686686
yvar: str,
687687
horizontal: bool,
688-
show_table: bool
688+
show_table: bool,
689+
color_col: str,
689690
):
690691
"""
691692
Initialize the figure and axes for the plotter function.
@@ -716,6 +717,8 @@ def initialize_fig(
716717
A boolean flag to determine if the plot is for horizontal plotting.
717718
show_table : dict
718719
A boolean flag to determine if the table will be shown in horizontal plot.
720+
color_col : str
721+
The column name for coloring the data points.
719722
"""
720723
# Params
721724
fig_size = plot_kwargs["fig_size"]
@@ -735,7 +738,10 @@ def initialize_fig(
735738
fig_size = (7, 1 + (frac * all_groups_count))
736739
else:
737740
if is_paired and show_pairs and proportional is False:
738-
frac = 0.8
741+
if color_col is not None and float_contrast:
742+
frac = 0.9
743+
else:
744+
frac = 0.8
739745
else:
740746
frac = 1
741747
if float_contrast:

dabest/plotter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ def effectsize_df_plotter(effectsize_df: object, **plot_kwargs) -> matplotlib.fi
176176
effect_size_type = effect_size,
177177
yvar = yvar,
178178
horizontal = horizontal,
179-
show_table = table_kwargs['show']
179+
show_table = table_kwargs['show'],
180+
color_col = color_col
180181
)
181182

182183
# Plotting the rawdata.

nbs/API/misc_tools.ipynb

+8-2
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,8 @@
739739
" effect_size_type: str, \n",
740740
" yvar: str, \n",
741741
" horizontal: bool, \n",
742-
" show_table: bool\n",
742+
" show_table: bool,\n",
743+
" color_col: str,\n",
743744
" ):\n",
744745
" \"\"\"\n",
745746
" Initialize the figure and axes for the plotter function.\n",
@@ -770,6 +771,8 @@
770771
" A boolean flag to determine if the plot is for horizontal plotting.\n",
771772
" show_table : dict\n",
772773
" A boolean flag to determine if the table will be shown in horizontal plot.\n",
774+
" color_col : str\n",
775+
" The column name for coloring the data points.\n",
773776
" \"\"\"\n",
774777
" # Params\n",
775778
" fig_size = plot_kwargs[\"fig_size\"]\n",
@@ -789,7 +792,10 @@
789792
" fig_size = (7, 1 + (frac * all_groups_count))\n",
790793
" else:\n",
791794
" if is_paired and show_pairs and proportional is False:\n",
792-
" frac = 0.8\n",
795+
" if color_col is not None and float_contrast:\n",
796+
" frac = 0.9\n",
797+
" else:\n",
798+
" frac = 0.8\n",
793799
" else:\n",
794800
" frac = 1\n",
795801
" if float_contrast:\n",

nbs/API/plotter.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@
233233
" effect_size_type = effect_size,\n",
234234
" yvar = yvar,\n",
235235
" horizontal = horizontal,\n",
236-
" show_table = table_kwargs['show']\n",
236+
" show_table = table_kwargs['show'],\n",
237+
" color_col = color_col\n",
237238
" )\n",
238239
" \n",
239240
" # Plotting the rawdata.\n",

0 commit comments

Comments
 (0)