Skip to content

Commit 319f513

Browse files
committed
Fixed bug involving empty_circle filled dots feature not working as intended
1 parent c71a4ee commit 319f513

2 files changed

Lines changed: 34 additions & 67 deletions

File tree

dabest/plotter.py

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs):
288288
for i in range(len(idx)):
289289
filled.append(False)
290290
filled.extend([True] * (len(idx[i]) - 1))
291+
print(f"filled is {filled}")
291292

292293
names = color_groups if not color_by_subgroups else idx
293294
n_groups = len(color_groups)
@@ -686,39 +687,22 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs):
686687
else:
687688
jitter = 1
688689

689-
if color_col is None: # Determine the use of hue
690-
rawdata_plot = swarmplot(
691-
data=plot_data,
692-
x=xvar,
693-
y=yvar,
694-
ax=rawdata_axes,
695-
order=all_plot_groups,
696-
hue=xvar,
697-
palette=plot_palette_raw,
698-
zorder=1,
699-
side=asymmetric_side,
700-
jitter=jitter,
701-
is_drop_gutter=True,
702-
gutter_limit=0.45,
703-
**swarmplot_kwargs
704-
)
705-
rawdata_plot.legend().set_visible(False)
706-
else:
707-
rawdata_plot = swarmplot(
708-
data=plot_data,
709-
x=xvar,
710-
y=yvar,
711-
ax=rawdata_axes,
712-
order=all_plot_groups,
713-
hue=color_col,
714-
palette=plot_palette_raw,
715-
zorder=1,
716-
side=asymmetric_side,
717-
jitter=jitter,
718-
is_drop_gutter=True,
719-
gutter_limit=0.45,
720-
**swarmplot_kwargs
721-
)
690+
rawdata_plot = swarmplot(
691+
data=plot_data,
692+
x=xvar,
693+
y=yvar,
694+
ax=rawdata_axes,
695+
order=all_plot_groups,
696+
hue=color_col,
697+
palette=plot_palette_raw,
698+
zorder=3,
699+
side=asymmetric_side,
700+
jitter=jitter,
701+
filled=filled,
702+
is_drop_gutter=True,
703+
gutter_limit=0.45,
704+
**swarmplot_kwargs,
705+
)
722706
else:
723707
# Plot the raw data as a barplot.
724708
bar1_df = pd.DataFrame(
@@ -1646,4 +1630,3 @@ def effectsize_df_plotter(effectsize_df, **plot_kwargs):
16461630

16471631
# Return the figure.
16481632
return fig
1649-

nbs/API/plotter.ipynb

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@
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",
350351
"\n",
351352
" names = color_groups if not color_by_subgroups else idx\n",
352353
" n_groups = len(color_groups)\n",
@@ -745,39 +746,22 @@
745746
" else:\n",
746747
" jitter = 1\n",
747748
"\n",
748-
" if color_col is None: # Determine the use of hue\n",
749-
" rawdata_plot = swarmplot(\n",
750-
" data=plot_data,\n",
751-
" x=xvar,\n",
752-
" y=yvar,\n",
753-
" ax=rawdata_axes,\n",
754-
" order=all_plot_groups,\n",
755-
" hue=xvar,\n",
756-
" palette=plot_palette_raw,\n",
757-
" zorder=1,\n",
758-
" side=asymmetric_side,\n",
759-
" jitter=jitter,\n",
760-
" is_drop_gutter=True,\n",
761-
" gutter_limit=0.45,\n",
762-
" **swarmplot_kwargs,\n",
763-
" )\n",
764-
" rawdata_plot.legend().set_visible(False)\n",
765-
" else:\n",
766-
" rawdata_plot = swarmplot(\n",
767-
" data=plot_data,\n",
768-
" x=xvar,\n",
769-
" y=yvar,\n",
770-
" ax=rawdata_axes,\n",
771-
" order=all_plot_groups,\n",
772-
" hue=color_col,\n",
773-
" palette=plot_palette_raw,\n",
774-
" zorder=1,\n",
775-
" side=asymmetric_side,\n",
776-
" jitter=jitter,\n",
777-
" is_drop_gutter=True,\n",
778-
" gutter_limit=0.45,\n",
779-
" **swarmplot_kwargs,\n",
780-
" )\n",
749+
" rawdata_plot = swarmplot(\n",
750+
" data=plot_data,\n",
751+
" x=xvar,\n",
752+
" y=yvar,\n",
753+
" ax=rawdata_axes,\n",
754+
" order=all_plot_groups,\n",
755+
" hue=color_col,\n",
756+
" palette=plot_palette_raw,\n",
757+
" zorder=3,\n",
758+
" side=asymmetric_side,\n",
759+
" jitter=jitter,\n",
760+
" filled=filled,\n",
761+
" is_drop_gutter=True,\n",
762+
" gutter_limit=0.45,\n",
763+
" **swarmplot_kwargs,\n",
764+
" )\n",
781765
" else:\n",
782766
" # Plot the raw data as a barplot.\n",
783767
" bar1_df = pd.DataFrame(\n",

0 commit comments

Comments
 (0)