Skip to content

Commit 8edb941

Browse files
committed
Updated errorbar handling of xspans to properly account for when hue column is being used to plot for color_col is not None
1 parent 9f33da3 commit 8edb941

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

nbs/API/plotter.ipynb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@
347347
" for i in range(len(idx)):\n",
348348
" filled.append(False)\n",
349349
" filled.extend([True] * (len(idx[i]) - 1))\n",
350-
" print(f\"filled is {filled}\")\n",
351350
"\n",
352351
" names = color_groups if not color_by_subgroups else idx\n",
353352
" n_groups = len(color_groups)\n",
@@ -360,7 +359,6 @@
360359
" unsat_colors = sns.color_palette(n_colors=n_groups)\n",
361360
" if empty_circle and not color_by_subgroups:\n",
362361
" unsat_colors = [sns.color_palette(\"gray\")[3]] + unsat_colors\n",
363-
" print(unsat_colors)\n",
364362
" else:\n",
365363
" if isinstance(custom_pal, dict):\n",
366364
" groups_in_palette = {\n",
@@ -823,13 +821,13 @@
823821
" if bootstraps_color_by_group:\n",
824822
" line_colors.append(plot_palette_raw[all_plot_groups[jj]])\n",
825823
"\n",
826-
" # Break the loop since hue in Seaborn adds collections to axes and it will result in index out of range\n",
827-
" if jj >= n_groups - 1 and color_col is None:\n",
828-
" break\n",
829-
"\n",
830824
" if len(line_colors) != len(all_plot_groups):\n",
831825
" line_colors = ytick_color\n",
832826
"\n",
827+
" # hue in swarmplot would add collections to axes which will result in len(xspans) = len(all_plot_groups) + len(unique groups in hue)\n",
828+
" if len(xspans) > len(all_plot_groups):\n",
829+
" xspans = xspans[:len(all_plot_groups)]\n",
830+
"\n",
833831
" error_bar(\n",
834832
" plot_data,\n",
835833
" x=xvar,\n",

0 commit comments

Comments
 (0)