|
534 | 534 | " xvar: str, \n", |
535 | 535 | " show_pairs: bool, \n", |
536 | 536 | " idx: list, \n", |
537 | | - " all_plot_groups: list\n", |
| 537 | + " all_plot_groups: list,\n", |
| 538 | + " delta2: bool,\n", |
538 | 539 | " ):\n", |
539 | 540 | " \"\"\"\n", |
540 | 541 | " Create the color palette to be used in the plotter function.\n", |
|
553 | 554 | " A list of tuples containing the group names.\n", |
554 | 555 | " all_plot_groups : list\n", |
555 | 556 | " A list of all the group names.\n", |
| 557 | + " delta2 : bool\n", |
| 558 | + " A boolean flag to determine if the plot will have a delta-delta effect size.\n", |
556 | 559 | " \"\"\"\n", |
557 | 560 | " # Create color palette that will be shared across subplots.\n", |
558 | 561 | " color_col = plot_kwargs[\"color_col\"]\n", |
|
603 | 606 | " unsat_colors = [sns.color_palette(\"gray\")[3]] + unsat_colors\n", |
604 | 607 | " else:\n", |
605 | 608 | " if isinstance(custom_pal, dict):\n", |
606 | | - " groups_in_palette = {\n", |
607 | | - " k: custom_pal[k] for k in all_plot_groups if k in color_groups\n", |
608 | | - " }\n", |
| 609 | + " if delta2:\n", |
| 610 | + " groups_in_palette = {\n", |
| 611 | + " k: custom_pal[k] for k in color_groups\n", |
| 612 | + " }\n", |
| 613 | + " elif color_col is None:\n", |
| 614 | + " groups_in_palette = {\n", |
| 615 | + " k: custom_pal[k] for k in all_plot_groups if k in color_groups\n", |
| 616 | + " }\n", |
| 617 | + " else:\n", |
| 618 | + " raise ValueError(\"The `custom_palette` dictionary is not supported when `color_col` is None.\")\n", |
609 | 619 | "\n", |
610 | 620 | " names = groups_in_palette.keys()\n", |
611 | 621 | " unsat_colors = groups_in_palette.values()\n", |
|
0 commit comments