@@ -154,8 +154,12 @@ def get_params(effectsize_df, plot_kwargs):
154154 if err_color is None :
155155 err_color = "black"
156156
157+ # Boolean for showing Baseline Curve
158+ show_baseline_ec = plot_kwargs ["show_baseline_ec" ]
159+
157160 return (dabest_obj , plot_data , xvar , yvar , is_paired , effect_size , proportional , all_plot_groups , idx ,
158- show_delta2 , show_mini_meta , float_contrast , show_pairs , effect_size_type , group_summaries , err_color )
161+ show_delta2 , show_mini_meta , float_contrast , show_pairs , effect_size_type , group_summaries , err_color ,
162+ show_baseline_ec )
159163
160164def get_kwargs (plot_kwargs , ytick_color ):
161165 """
@@ -627,7 +631,9 @@ def extract_contrast_plotting_ticks(is_paired, show_pairs, two_col_sankey, plot_
627631 t for t in range (0 , len (plot_groups )) if t not in ticks_to_skip
628632 ]
629633
630- return ticks_to_skip , ticks_to_plot , ticks_to_skip_contrast , ticks_to_start_twocol_sankey
634+ ticks_for_baseline_ec = ticks_to_skip
635+
636+ return ticks_to_skip , ticks_to_plot , ticks_for_baseline_ec , ticks_to_skip_contrast , ticks_to_start_twocol_sankey
631637
632638def set_xaxis_ticks_and_lims (show_delta2 , show_mini_meta , rawdata_axes , contrast_axes , show_pairs , float_contrast ,
633639 ticks_to_skip , contrast_xtick_labels , plot_kwargs ):
@@ -904,70 +910,70 @@ def Cumming_Plot_Aesthetic_Adjustments(plot_kwargs, show_delta2, effect_size_typ
904910 contrast_axes .axhline (y = 0 , ** reflines_kwargs )
905911
906912 if is_paired == "baseline" and show_pairs :
907- if two_col_sankey :
908- rightend_ticks_raw = np .array ([len (i ) - 2 for i in idx ]) + np .array (
909- ticks_to_start_twocol_sankey
910- )
911- elif proportional and is_paired is not None :
912- rightend_ticks_raw = np .array ([len (i ) - 1 for i in idx ]) + np .array (
913- ticks_to_skip
914- )
915- else :
916- rightend_ticks_raw = np .array (
917- [len (i ) - 1 for i in temp_idx ]
918- ) + np .array (ticks_to_skip )
919- for ax in [rawdata_axes ]:
920- sns .despine (ax = ax , bottom = True )
921-
922- ylim = ax .get_ylim ()
923- xlim = ax .get_xlim ()
924- redraw_axes_kwargs ["y" ] = ylim [0 ]
925-
926- if two_col_sankey :
927- for k , start_tick in enumerate (ticks_to_start_twocol_sankey ):
928- end_tick = rightend_ticks_raw [k ]
929- ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
930- else :
931- for k , start_tick in enumerate (ticks_to_skip ):
932- end_tick = rightend_ticks_raw [k ]
933- ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
934- ax .set_ylim (ylim )
935- del redraw_axes_kwargs ["y" ]
936-
937- if not proportional :
938- temp_length = [(len (i ) - 1 ) for i in idx ]
939- else :
940- temp_length = [(len (i ) - 1 ) * 2 - 1 for i in idx ]
941- if two_col_sankey :
942- rightend_ticks_contrast = np .array (
943- [len (i ) - 2 for i in idx ]
944- ) + np .array (ticks_to_start_twocol_sankey )
945- elif proportional and is_paired is not None :
946- rightend_ticks_contrast = np .array (
947- [len (i ) - 1 for i in idx ]
948- ) + np .array (ticks_to_skip )
949- else :
950- rightend_ticks_contrast = np .array (temp_length ) + np .array (
951- ticks_to_skip_contrast
952- )
953- for ax in [contrast_axes ]:
954- sns .despine (ax = ax , bottom = True )
955-
956- ylim = ax .get_ylim ()
957- xlim = ax .get_xlim ()
958- redraw_axes_kwargs ["y" ] = ylim [0 ]
959-
960- if two_col_sankey :
961- for k , start_tick in enumerate (ticks_to_start_twocol_sankey ):
962- end_tick = rightend_ticks_contrast [k ]
963- ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
964- else :
965- for k , start_tick in enumerate (ticks_to_skip_contrast ):
966- end_tick = rightend_ticks_contrast [k ]
967- ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
968-
969- ax .set_ylim (ylim )
970- del redraw_axes_kwargs ["y" ]
913+ if two_col_sankey :
914+ rightend_ticks_raw = np .array ([len (i ) - 2 for i in idx ]) + np .array (
915+ ticks_to_start_twocol_sankey
916+ )
917+ elif proportional and is_paired is not None :
918+ rightend_ticks_raw = np .array ([len (i ) - 1 for i in idx ]) + np .array (
919+ ticks_to_skip
920+ )
921+ else :
922+ rightend_ticks_raw = np .array (
923+ [len (i ) - 1 for i in temp_idx ]
924+ ) + np .array (ticks_to_skip )
925+ for ax in [rawdata_axes ]:
926+ sns .despine (ax = ax , bottom = True )
927+
928+ ylim = ax .get_ylim ()
929+ xlim = ax .get_xlim ()
930+ redraw_axes_kwargs ["y" ] = ylim [0 ]
931+
932+ if two_col_sankey :
933+ for k , start_tick in enumerate (ticks_to_start_twocol_sankey ):
934+ end_tick = rightend_ticks_raw [k ]
935+ ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
936+ else :
937+ for k , start_tick in enumerate (ticks_to_skip ):
938+ end_tick = rightend_ticks_raw [k ]
939+ ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
940+ ax .set_ylim (ylim )
941+ del redraw_axes_kwargs ["y" ]
942+
943+ if not proportional :
944+ temp_length = [(len (i ) - 1 ) for i in idx ]
945+ else :
946+ temp_length = [(len (i ) - 1 ) * 2 - 1 for i in idx ]
947+ if two_col_sankey :
948+ rightend_ticks_contrast = np .array (
949+ [len (i ) - 2 for i in idx ]
950+ ) + np .array (ticks_to_start_twocol_sankey )
951+ elif proportional and is_paired is not None :
952+ rightend_ticks_contrast = np .array (
953+ [len (i ) - 1 for i in idx ]
954+ ) + np .array (ticks_to_skip )
955+ else :
956+ rightend_ticks_contrast = np .array (temp_length ) + np .array (
957+ ticks_to_skip_contrast
958+ )
959+ for ax in [contrast_axes ]:
960+ sns .despine (ax = ax , bottom = True )
961+
962+ ylim = ax .get_ylim ()
963+ xlim = ax .get_xlim ()
964+ redraw_axes_kwargs ["y" ] = ylim [0 ]
965+
966+ if two_col_sankey :
967+ for k , start_tick in enumerate (ticks_to_start_twocol_sankey ):
968+ end_tick = rightend_ticks_contrast [k ]
969+ ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
970+ else :
971+ for k , start_tick in enumerate (ticks_to_skip_contrast ):
972+ end_tick = rightend_ticks_contrast [k ]
973+ ax .hlines (xmin = start_tick , xmax = end_tick , ** redraw_axes_kwargs )
974+
975+ ax .set_ylim (ylim )
976+ del redraw_axes_kwargs ["y" ]
971977 else :
972978 # Compute the end of each x-axes line.
973979 if two_col_sankey :
0 commit comments