Skip to content

Commit cada3ca

Browse files
committed
Minor kwarg name change for delta_text_kwargs
1 parent 8757b26 commit cada3ca

14 files changed

+48
-169
lines changed

dabest/_effsize_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ def plot(
12131213
Pass relevant keyword arguments to the delta text. Pass any keyword arguments accepted by
12141214
matplotlib.text.Text here, as a string. If None, the following keywords are passed:
12151215
{"color": None, "alpha": 1, "fontsize": 10, "ha": 'center', "va": 'center', "rotation": 0,
1216-
"x_location": 'right', "x_coordinates": None, "y_coordinates": None, "x_adjust": 0}
1216+
"x_location": 'right', "x_coordinates": None, "y_coordinates": None, "offset": 0}
12171217
Use "x_coordinates" and "y_coordinates" if you would like to specify the text locations manually.
12181218
Use "x_adjust" to adjust the x location of all the texts (positive moves right, negative left).
12191219
delta_dot : boolean, default True

dabest/misc_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def get_kwargs(
347347
"x_location": 'right',
348348
"x_coordinates": None,
349349
"y_coordinates": None,
350-
"x_adjust": 0
350+
"offset": 0
351351
}
352352
if plot_kwargs["delta_text_kwargs"] is None:
353353
delta_text_kwargs = default_delta_text_kwargs

dabest/plot_tools.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,8 @@ def delta_text_plotter(
12241224
if show_mini_meta: Delta_Values.append(mini_meta_delta.difference)
12251225

12261226
# Collect the X-coordinates for the delta text
1227-
delta_text_x_coordinates = delta_text_kwargs.get('x_coordinates')
1228-
delta_text_x_adjustment = delta_text_kwargs.get('x_adjust')
1227+
delta_text_x_coordinates = delta_text_kwargs.pop('x_coordinates')
1228+
delta_text_x_adjustment = delta_text_kwargs.pop('offset')
12291229

12301230
if delta_text_x_coordinates is not None:
12311231
if not isinstance(delta_text_x_coordinates, (list, tuple)) or not all(isinstance(x, (int, float)) for x in delta_text_x_coordinates):
@@ -1240,8 +1240,6 @@ def delta_text_plotter(
12401240
if show_mini_meta: delta_text_x_coordinates.append(max(swarm_plot_ax.get_xticks())+2+X_Adjust)
12411241
if show_delta2: delta_text_x_coordinates.append(max(swarm_plot_ax.get_xticks())+2-0.35)
12421242
if show_mini_meta or show_delta2: ticks_to_plot.append(max(ticks_to_plot)+1)
1243-
delta_text_kwargs.pop('x_coordinates')
1244-
delta_text_kwargs.pop('x_adjust')
12451243

12461244
# Collect the Y-coordinates for the delta text
12471245
delta_text_y_coordinates = delta_text_kwargs.get('y_coordinates')

nbs/API/effsize_objects.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@
13721372
" Pass relevant keyword arguments to the delta text. Pass any keyword arguments accepted by\n",
13731373
" matplotlib.text.Text here, as a string. If None, the following keywords are passed:\n",
13741374
" {\"color\": None, \"alpha\": 1, \"fontsize\": 10, \"ha\": 'center', \"va\": 'center', \"rotation\": 0, \n",
1375-
" \"x_location\": 'right', \"x_coordinates\": None, \"y_coordinates\": None, \"x_adjust\": 0}\n",
1375+
" \"x_location\": 'right', \"x_coordinates\": None, \"y_coordinates\": None, \"offset\": 0}\n",
13761376
" Use \"x_coordinates\" and \"y_coordinates\" if you would like to specify the text locations manually. \n",
13771377
" Use \"x_adjust\" to adjust the x location of all the texts (positive moves right, negative left).\n",
13781378
" delta_dot : boolean, default True\n",

nbs/API/misc_tools.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@
400400
" \"x_location\": 'right', \n",
401401
" \"x_coordinates\": None, \n",
402402
" \"y_coordinates\": None,\n",
403-
" \"x_adjust\": 0\n",
403+
" \"offset\": 0\n",
404404
" }\n",
405405
" if plot_kwargs[\"delta_text_kwargs\"] is None:\n",
406406
" delta_text_kwargs = default_delta_text_kwargs\n",

nbs/API/plot_tools.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,8 @@
12741274
" if show_mini_meta: Delta_Values.append(mini_meta_delta.difference)\n",
12751275
"\n",
12761276
" # Collect the X-coordinates for the delta text\n",
1277-
" delta_text_x_coordinates = delta_text_kwargs.get('x_coordinates')\n",
1278-
" delta_text_x_adjustment = delta_text_kwargs.get('x_adjust')\n",
1277+
" delta_text_x_coordinates = delta_text_kwargs.pop('x_coordinates')\n",
1278+
" delta_text_x_adjustment = delta_text_kwargs.pop('offset')\n",
12791279
"\n",
12801280
" if delta_text_x_coordinates is not None:\n",
12811281
" if not isinstance(delta_text_x_coordinates, (list, tuple)) or not all(isinstance(x, (int, float)) for x in delta_text_x_coordinates):\n",
@@ -1290,8 +1290,6 @@
12901290
" if show_mini_meta: delta_text_x_coordinates.append(max(swarm_plot_ax.get_xticks())+2+X_Adjust)\n",
12911291
" if show_delta2: delta_text_x_coordinates.append(max(swarm_plot_ax.get_xticks())+2-0.35)\n",
12921292
" if show_mini_meta or show_delta2: ticks_to_plot.append(max(ticks_to_plot)+1)\n",
1293-
" delta_text_kwargs.pop('x_coordinates')\n",
1294-
" delta_text_kwargs.pop('x_adjust')\n",
12951293
"\n",
12961294
" # Collect the Y-coordinates for the delta text\n",
12971295
" delta_text_y_coordinates = delta_text_kwargs.get('y_coordinates')\n",

nbs/tests/mpl_image_tests/test_plot_aesthetics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_227_multi_2group_meandiff_deltatext_kwargs_specificy_coordinates():
278278

279279
@pytest.mark.mpl_image_compare(tolerance=8)
280280
def test_228_multi_2group_meandiff_deltatext_kwargs_x_adjust():
281-
return multi_2group.mean_diff.plot(delta_text=True, delta_text_kwargs={"x_adjust":0.1});
281+
return multi_2group.mean_diff.plot(delta_text=True, delta_text_kwargs={"offset":0.1});
282282

283283
# Jitter
284284
@pytest.mark.mpl_image_compare(tolerance=8)

nbs/tutorials/01-basics.ipynb

Lines changed: 10 additions & 27 deletions
Large diffs are not rendered by default.

nbs/tutorials/02-repeated_measures.ipynb

Lines changed: 6 additions & 14 deletions
Large diffs are not rendered by default.

nbs/tutorials/03-proportion_plot.ipynb

Lines changed: 3 additions & 27 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)