|
236 | 236 | " gridkey_show_Ns = plot_kwargs[\"gridkey_show_Ns\"]\n", |
237 | 237 | " gridkey_show_es = plot_kwargs[\"gridkey_show_es\"]\n", |
238 | 238 | " \n", |
| 239 | + " if gridkey_rows == None:\n", |
| 240 | + " gridkey_show_Ns = False\n", |
| 241 | + " gridkey_show_es = False\n", |
| 242 | + " \n", |
239 | 243 | "################################################### END GRIDKEY WIP - extracting kwargs\n", |
240 | 244 | "\n", |
241 | 245 | " # Group summaries kwargs.\n", |
|
364 | 368 | "###################### GRIDKEY HSPACE ALTERATION\n", |
365 | 369 | "\n", |
366 | 370 | " # Sets hspace for cummings plots if gridkey is shown.\n", |
367 | | - " if gridkey_rows is not None:\n", |
| 371 | + " if gridkey_rows != None:\n", |
368 | 372 | " h_space_cummings = 0.1\n", |
369 | 373 | " else:\n", |
370 | 374 | " h_space_cummings = 0.3\n", |
371 | 375 | " \n", |
| 376 | + " ##### TESTING SOME SHIT\n", |
| 377 | + " \n", |
| 378 | + " \n", |
372 | 379 | "###################### END GRIDKEY HSPACE ALTERATION \n", |
373 | 380 | " \n", |
374 | 381 | " if plot_kwargs[\"ax\"] is not None:\n", |
|
497 | 504 | " slopegraph_kwargs['label'] = color_key\n", |
498 | 505 | "\n", |
499 | 506 | " rawdata_axes.plot(x_points, y_points, **slopegraph_kwargs)\n", |
| 507 | + " \n", |
500 | 508 | " x_start = x_start + grp_count\n", |
501 | 509 | " # Set the tick labels, because the slopegraph plotting doesn't.\n", |
502 | 510 | " rawdata_axes.set_xticks(np.arange(0, len(temp_all_plot_groups)))\n", |
|
716 | 724 | " color=ytick_color,\n", |
717 | 725 | " markersize=es_marker_size)\n", |
718 | 726 | " \n", |
| 727 | + "################## SHOW ES ON CONTRAST PLOT WIP \n", |
| 728 | + "\n", |
| 729 | + " contrast_show_es = plot_kwargs[\"contrast_show_es\"]\n", |
| 730 | + " es_sf = plot_kwargs['es_sf']\n", |
| 731 | + " es_fontsize = plot_kwargs['es_fontsize']\n", |
| 732 | + " \n", |
| 733 | + " if gridkey_show_es == True:\n", |
| 734 | + " contrast_show_es = False\n", |
| 735 | + " \n", |
| 736 | + "\n", |
| 737 | + " \n", |
| 738 | + " effsize_for_print = current_effsize\n", |
| 739 | + " \n", |
| 740 | + " printed_es = np.format_float_positional(effsize_for_print,\n", |
| 741 | + " precision=es_sf,\n", |
| 742 | + " sign=True,\n", |
| 743 | + " trim= 'k',\n", |
| 744 | + " min_digits = es_sf)\n", |
| 745 | + " if contrast_show_es == True:\n", |
| 746 | + " if effsize_for_print < 0:\n", |
| 747 | + " textoffset = 10\n", |
| 748 | + " else:\n", |
| 749 | + " textoffset = 15\n", |
| 750 | + " contrast_axes.annotate(text=printed_es, \n", |
| 751 | + " xy = (tick, effsize_for_print),\n", |
| 752 | + " xytext = (-textoffset-len(printed_es)*es_fontsize/2,-es_fontsize/2),\n", |
| 753 | + " textcoords = \"offset points\",\n", |
| 754 | + " **{ \"fontsize\" : es_fontsize })\n", |
| 755 | + " \n", |
| 756 | + "################## SHOW ES ON CONTRAST PLOT END \n", |
| 757 | + " \n", |
719 | 758 | " # Plot the confidence interval.\n", |
720 | 759 | " contrast_axes.plot([tick, tick],\n", |
721 | 760 | " [current_ci_low, current_ci_high],\n", |
|
1216 | 1255 | " if isinstance(gridkey_rows, list) is False:\n", |
1217 | 1256 | " raise TypeError(\"gridkey_rows must be a list.\")\n", |
1218 | 1257 | " elif len(gridkey_rows) == 0:\n", |
1219 | | - " raise ValueError(\"gridkey_rows cannot be an empty list.\")\n", |
| 1258 | + " warnings.warn(\"gridkey_rows is an empty list.\")\n", |
1220 | 1259 | " \n", |
1221 | 1260 | " \n", |
1222 | 1261 | " # raise Warning if an item in gridkey_rows is not contained in any idx\n", |
|
1264 | 1303 | " for i in enumerate(groups_for_gridkey):\n", |
1265 | 1304 | " if i[1] in results_list:\n", |
1266 | 1305 | " curr_esval = results.loc[results[\"test\"] == i[1]][\"difference\"].iloc[0]\n", |
1267 | | - " if curr_esval >= 0: \n", |
1268 | | - " curr_esval_str = \"+\" + str(\"%.2f\" % curr_esval)\n", |
1269 | | - " else:\n", |
1270 | | - " curr_esval_str = str(\"%.2f\" % curr_esval)\n", |
| 1306 | + " curr_esval_str = np.format_float_positional(curr_esval,\n", |
| 1307 | + " precision=es_sf,\n", |
| 1308 | + " sign=True,\n", |
| 1309 | + " trim= 'k',\n", |
| 1310 | + " min_digits = es_sf)\n", |
1271 | 1311 | " effsize_list.append(curr_esval_str)\n", |
1272 | 1312 | " else:\n", |
1273 | 1313 | " effsize_list.append(\"-\")\n", |
|
0 commit comments