API Documentation
add_errorbar_loc_on_posthoc(posthoc_df, bar_coords, overwrite_num_loc=True)
merges posthoc df with newly created errorbar span detection
Source code in plot_posthoc_test\plot_stat_annotate.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
get_ax_children_types(ax_obj)
To- return list stating what type each child of the mplt ax object is
Source code in plot_posthoc_test\plot_stat_annotate.py
22 23 24 | |
get_child_df_row(hue_cat_loc, hue_num_loc, bar_coords)
non vectorized function relying on vectorized subfuunctions
Source code in plot_posthoc_test\plot_stat_annotate.py
82 83 84 85 86 87 88 89 90 91 | |
get_hue_errorbar_loc_dict(ax_input, hue_order)
Get a dictionary of the data errorbars at each level of the hue variable.
Parameters: ax_input (matplotlib.axes.Axes): The input axis object. hue_order (list): The order of the hue in a list.
Returns: dict: Dictionary with hue errorbar locations.
Source code in plot_posthoc_test\plot_stat_annotate.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
get_hue_loc_on_axis(hue_loc_df, posthoc_df, detect_error_bar=False)
Add numerical and categorical axis locations to the posthoc comparison dataframe. Main function creating/label numeric loc on axis NEW (2.6.25)- add detect errorbar to automatically detect errorbar, and move point marked for symbol loc if so Parameters: hue_loc_df (pandas.DataFrame): DataFrame with hue locations. posthoc_df (pandas.DataFrame): DataFrame with posthoc comparisons.
Returns: pandas.DataFrame: Updated DataFrame with axis locations.
Source code in plot_posthoc_test\plot_stat_annotate.py
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
get_hue_point_loc_df(ax_input, hue_order)
Get a DataFrame of the datapoints at each level of the hue variable.
Parameters: ax_input (matplotlib.axes.Axes): The input axis object. hue_order (list): The order of the hue.
Returns: pandas.DataFrame: DataFrame with hue point locations.
Source code in plot_posthoc_test\plot_stat_annotate.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
get_hue_point_loc_dict(ax_input, hue_order)
Get a dictionary of the datapoints at each level of the hue variable.
Parameters: ax_input (matplotlib.axes.Axes): The input axis object. hue_order (list): The order of the hue.
Returns: dict: Dictionary with hue point locations.
Source code in plot_posthoc_test\plot_stat_annotate.py
477 478 479 480 481 482 483 484 485 486 487 488 489 | |
get_pair_stat_test_result(test_name, ax_category_level, group_order, group_1_name, group_2_name, data_group_1_values, data_group_2_values, ax_var_is_hue=False)
Run statistical test on data groups.
Parameters: test_name (str): The name of the test. ax_category_level (str): The axis category level. group_order (iterable): The order of the groups. group_1_name (str): The name of the first group. group_2_name (str): The name of the second group. data_group_1_values (numpy.ndarray): Values of the first group. data_group_2_values (numpy.ndarray): Values of the second group. ax_var_is_hue (bool, optional): Whether the axis variable is the hue. Defaults to False.
Returns: dict: Dictionary with the statistical test results.
Source code in plot_posthoc_test\plot_stat_annotate.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
get_sig_bar_x_vals(comparison_tuple)
Get the x-values for the significance bar.
Parameters: comparison_tuple (namedtuple): Tuple with comparison information.
Returns: list: List of x-values for the significance bar.
Source code in plot_posthoc_test\plot_stat_annotate.py
505 506 507 508 509 510 511 512 513 514 515 516 517 | |
get_sig_bar_y_vals(bottom_val=None, line_height=1.01)
Get the y-values for the significance bar. Parameters: bottom_val (float, optional): The bottom value for the bar. Defaults to 0.95. line_height (float, optional): The height of the line. Defaults to 1.01.
Returns: list: List of y-values for the significance bar.
Source code in plot_posthoc_test\plot_stat_annotate.py
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | |
get_x_ticks_as_df(ticklabel_obj)
Get a DataFrame of the x-tick labels and their positions.
Parameters: ticklabel_obj (list): List of tick label objects.
Returns: pandas.DataFrame: DataFrame with x-tick labels and positions.
Source code in plot_posthoc_test\plot_stat_annotate.py
491 492 493 494 495 496 497 498 499 500 501 502 | |
is_val_between_range_min_max(value, range_array)
smple function
Source code in plot_posthoc_test\plot_stat_annotate.py
66 67 68 69 70 | |
main_run_posthoc_tests_and_get_hue_loc_df(ax_input, plot_params, plot_obj, preset_comparisons, hue_var=None, test_name=None, hue_order=None, ax_var_is_hue=False, detect_error_bar=False)
Run posthoc tests on all axis ticks, get hue levels for each axis tick, and join this to the dataframe produced.
Parameters: ax_input (matplotlib.axes.Axes): The input axis object. plot_params (dict): Dictionary containing plot parameters. plot_obj (seaborn.axisgrid.FacetGrid): The plot object. preset_comparisons (list): List of preset comparisons. hue_var (str, optional): The hue variable. Defaults to None. test_name (str, optional): The name of the test. Defaults to None. hue_order (list, optional): The order of the hue. Defaults to None. ax_var_is_hue (bool, optional): Whether the axis variable is the hue. Defaults to False.
Returns: pandas.DataFrame: DataFrame with posthoc test results and hue locations.
Source code in plot_posthoc_test\plot_stat_annotate.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
plot_sig_bars_w_comp_df(ax_input, sig_comp_df, direction_to_plot=None)
Plot significance bars with comparison dataframe.
Parameters: ax_input (matplotlib.axes.Axes): The input axis object. sig_comp_df (pandas.DataFrame): DataFrame with significance comparisons. direction_to_plot (str, optional): Direction to plot ('top_down', 'bottom_up'). Defaults to 'bottom_up'. TO- given parameters, plot vertical lines between centers of datapoints of interest (pre-sorted), with significance star (pre-calculated)
Source code in plot_posthoc_test\plot_stat_annotate.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
plot_sig_bars_w_comp_df_tight(ax_input, sig_comp_df, direction_to_plot=None, tight=None, tight_offset=None, offset_constant=None, debug=None)
Plot significance bars with comparison dataframe, using a tight layout. TO- given parameters, plot vertical lines between centers of datapoints of interest (pre-sorted), with significance star (pre-calculated) Parameters ax_input (matplotlib.axes.Axes): The input axis object. sig_comp_df (pandas.DataFrame): DataFrame with significance comparisons. direction_to_plot (str, optional): Direction to plot ('top_down', 'bottom_up'). Defaults to 'bottom_up'. tight (bool, optional): Whether to plot bars right above their corresponding values. Defaults to True. tight_offset (float, optional): Offset for tight layout. Defaults to 0.075. offset_constant (float, optional): Constant for offset. Defaults to 0.0225. debug (bool, optional): Whether to print debug information. Defaults to None.
Source code in plot_posthoc_test\plot_stat_annotate.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
return_ax_child_line_coor(ax_childs, ax_child_points_index)
Given a set of indices of the ax child objects between which to query (e.g. path collections index), find fully nonnan yvals in the lines (corresponding to the actual real vertical errorbar) and return coords
Source code in plot_posthoc_test\plot_stat_annotate.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
run_posthoc_test_on_tick_hue_groups(ax_tick_data, hue_group_1, hue_group_2, ax_category_level, group_order, hue_col_name, value_cols_name, test_name=None, ax_var_is_hue=False)
Run posthoc test on tick hue groups. Use existing dataframe filtered by the current axis levels, and perform stats on the hue groups.
Parameters: ax_tick_data (pandas.DataFrame): The axis tick corresponding dataframe. hue_group_1 (str): The first hue group. hue_group_2 (str): The second hue group. ax_category_level (str): The axis category level. group_order (iterable): The order of the groups. hue_col_name (str): The hue column name. value_cols_name (str): The value column name. test_name (str, optional): The name of the test. Defaults to 'MWU'. ax_var_is_hue (bool, optional): Whether the axis variable is the hue. Defaults to False.
Returns: dict: Dictionary with the posthoc test results.
Source code in plot_posthoc_test\plot_stat_annotate.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
run_posthoc_tests_on_all_ax_ticks(plot_data, plot_obj, comparison_list, ax_grouping_col, group_order, hue_col_name, value_col_name, test_name=None, ax_var_is_hue=False)
Run posthoc tests on all axis ticks.
Parameters: plot_data (pandas.DataFrame): The plot data. plot_obj (seaborn.axisgrid.FacetGrid): The plot object. comparison_list (list): List of comparisons. ax_grouping_col (str): The column name for axis grouping. group_order (iterable): The order of the groups. hue_col_name (str): The hue column name. value_col_name (str): The value column name. test_name (str, optional): The name of the test. Defaults to 'MWU'. ax_var_is_hue (bool, optional): Whether the axis variable is the hue. Defaults to False.
Returns: pandas.DataFrame: DataFrame with posthoc test results.
Source code in plot_posthoc_test\plot_stat_annotate.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |