@@ -384,28 +384,34 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
384384
385385 if show_pairs is True :
386386 if is_paired == "baseline" :
387- temp_idx = []
388- for i in idx :
389- control = i [0 ]
390- temp_idx .extend (((control , test ) for test in i [1 :]))
391- temp_idx = tuple (temp_idx )
392-
393- temp_all_plot_groups = []
394- for i in temp_idx :
395- temp_all_plot_groups .extend (list (i ))
387+ if proportional == False :
388+ temp_idx = idx
389+ temp_all_plot_groups = all_plot_groups
390+ else :
391+ temp_idx = []
392+ for i in idx :
393+ control = i [0 ]
394+ temp_idx .extend (((control , test ) for test in i [1 :]))
395+ temp_idx = tuple (temp_idx )
396+
397+ temp_all_plot_groups = []
398+ for i in temp_idx :
399+ temp_all_plot_groups .extend (list (i ))
396400 else :
397- temp_idx = []
398- for i in idx :
399- for j in range (len (i )- 1 ):
400- control = i [j ]
401- test = i [j + 1 ]
402- temp_idx .append ((control , test ))
403- temp_all_plot_groups = []
404- for i in temp_idx :
405- temp_all_plot_groups .extend (list (i ))
401+ if proportional == False :
402+ temp_idx = idx
403+ temp_all_plot_groups = all_plot_groups
404+ else :
405+ temp_idx = []
406+ for i in idx :
407+ for j in range (len (i )- 1 ):
408+ control = i [j ]
409+ test = i [j + 1 ]
410+ temp_idx .append ((control , test ))
411+ temp_all_plot_groups = []
412+ for i in temp_idx :
413+ temp_all_plot_groups .extend (list (i ))
406414 if proportional == False :
407- temp_idx = idx
408- temp_all_plot_groups = all_plot_groups
409415 # Plot the raw data as a slopegraph.
410416 # Pivot the long (melted) data.
411417 if color_col is None :
@@ -447,9 +453,9 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
447453 # Set the tick labels, because the slopegraph plotting doesn't.
448454 rawdata_axes .set_xticks (np .arange (0 , len (temp_all_plot_groups )))
449455 rawdata_axes .set_xticklabels (temp_all_plot_groups )
456+
450457 else :
451458 # Plot the raw data as a set of Sankey Diagrams aligned like barplot.
452-
453459 group_summaries = plot_kwargs ["group_summaries" ]
454460 if group_summaries is None :
455461 group_summaries = "mean_sd"
@@ -590,9 +596,14 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
590596 ticks_to_start_sankey .pop ()
591597 ticks_to_start_sankey .insert (0 , 0 )
592598 else :
593- ticks_to_skip = np .arange (0 , len (temp_all_plot_groups ), 2 ).tolist ()
594- ticks_to_plot = np .arange (1 , len (temp_all_plot_groups ), 2 ).tolist ()
595- ticks_to_skip_contrast = np .cumsum ([(len (t )- 1 )* 2 for t in idx ])[:- 1 ].tolist ()
599+ # ticks_to_skip = np.arange(0, len(temp_all_plot_groups), 2).tolist()
600+ # ticks_to_plot = np.arange(1, len(temp_all_plot_groups), 2).tolist()
601+ ticks_to_skip = np .cumsum ([len (t ) for t in idx ])[:- 1 ].tolist ()
602+ ticks_to_skip .insert (0 , 0 )
603+ # Then obtain the ticks where we have to plot the effect sizes.
604+ ticks_to_plot = [t for t in range (0 , len (all_plot_groups ))
605+ if t not in ticks_to_skip ]
606+ ticks_to_skip_contrast = np .cumsum ([(len (t )) for t in idx ])[:- 1 ].tolist ()
596607 ticks_to_skip_contrast .insert (0 , 0 )
597608 else :
598609 if proportional == True and one_sankey == False :
@@ -976,7 +987,10 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
976987 ax .set_ylim (ylim )
977988 del redraw_axes_kwargs ['y' ]
978989
979- temp_length = [(len (i )- 1 )* 2 - 1 for i in idx ]
990+ if proportional == False :
991+ temp_length = [(len (i )- 1 ) for i in idx ]
992+ else :
993+ temp_length = [(len (i )- 1 )* 2 - 1 for i in idx ]
980994 if proportional == True and one_sankey == False :
981995 rightend_ticks_contrast = np .array ([len (i )- 2 for i in idx ]) + np .array (ticks_to_start_sankey )
982996 else :
0 commit comments