|
606 | 606 | " delta_df[yvar] = temp_df_exp[yvar] - temp_df_cont[yvar]\n", |
607 | 607 | " final_deltas = pd.concat([final_deltas, delta_df])\n", |
608 | 608 | "\n", |
609 | | - " # Change jitter for Gardner-Altman plot\n", |
| 609 | + " # swarmplot() plots swarms based on current size of ax\n", |
| 610 | + " # Therefore, since the ax size for Gardner-Altman plot changes later on, there has to be decreased jitter\n", |
| 611 | + " # TODO: to make jitter value more accurate and not just a hardcoded eyeball value\n", |
610 | 612 | " if float_contrast:\n", |
611 | 613 | " jitter = 0.6\n", |
612 | 614 | " else:\n", |
|
686 | 688 | " else:\n", |
687 | 689 | " if not proportional:\n", |
688 | 690 | " # Plot the raw data as a swarmplot.\n", |
689 | | - " asymmetric_side = \"right\"\n", |
| 691 | + " asymmetric_side = (\n", |
| 692 | + " plot_kwargs[\"swarm_side\"] if plot_kwargs[\"swarm_side\"] is not None else \"right\"\n", |
| 693 | + " ) # Default asymmetric side is right\n", |
| 694 | + "\n", |
| 695 | + " # swarmplot() plots swarms based on current size of ax\n", |
| 696 | + " # Therefore, since the ax size for mini_meta and show_delta changes later on, there has to be increased jitter\n", |
| 697 | + " # TODO: to make jitter value more accurate and not just a hardcoded eyeball value\n", |
690 | 698 | " if show_mini_meta:\n", |
691 | 699 | " jitter = 1.25\n", |
692 | 700 | " elif show_delta2:\n", |
|
757 | 765 | " for jj, c in enumerate(rawdata_axes.collections):\n", |
758 | 766 | " try:\n", |
759 | 767 | " if asymmetric_side == \"right\":\n", |
| 768 | + " # currently offset is hardcoded with value of -0.2\n", |
760 | 769 | " x_max_span = -0.2\n", |
761 | 770 | " else:\n", |
762 | 771 | " _, x_max, _, _ = get_swarm_spans(c)\n", |
|
0 commit comments