|
1281 | 1281 | "\n", |
1282 | 1282 | " if float_contrast:\n", |
1283 | 1283 | " contrast_axes.set_xlim(0.5, 1.5)\n", |
1284 | | - " elif show_delta2 or show_mini_meta:\n", |
| 1284 | + "\n", |
| 1285 | + " if show_delta2:\n", |
| 1286 | + " if show_pairs:\n", |
| 1287 | + " rawdata_axes.set_xlim(-0.375, 5.5)\n", |
| 1288 | + " else:\n", |
| 1289 | + " rawdata_axes.set_xlim(-0.5, 5.5)\n", |
| 1290 | + " contrast_axes.set_xlim(rawdata_axes.get_xlim())\n", |
| 1291 | + "\n", |
| 1292 | + " elif show_mini_meta:\n", |
1285 | 1293 | " # Increase the xlim of raw data by 2\n", |
1286 | 1294 | " temp = rawdata_axes.get_xlim()\n", |
1287 | 1295 | " if show_pairs:\n", |
|
1583 | 1591 | "def draw_zeroline(\n", |
1584 | 1592 | " ax : axes.Axes,\n", |
1585 | 1593 | " horizontal : bool,\n", |
1586 | | - " reflines_kwargs : dict\n", |
| 1594 | + " reflines_kwargs : dict,\n", |
| 1595 | + " extra_delta : bool,\n", |
1587 | 1596 | " ):\n", |
1588 | 1597 | " # If 0 lies within the ylim of the contrast axes, draw a zero reference line.\n", |
1589 | | - " ax_lim = ax.get_xlim() if horizontal else ax.get_ylim()\n", |
1590 | | - " method = ax.axvline if horizontal else ax.axhline\n", |
| 1598 | + " if extra_delta and not horizontal:\n", |
| 1599 | + " contrast_xlim = [-0.5, 3.5]\n", |
| 1600 | + " delta2_xlim = [4, 5.5]\n", |
| 1601 | + " \n", |
| 1602 | + " if ax.get_ylim()[0] < ax.get_ylim()[1]:\n", |
| 1603 | + " contrast_lim_low, contrast_lim_high = ax.get_ylim()\n", |
| 1604 | + " else:\n", |
| 1605 | + " contrast_lim_high, contrast_lim_low = ax.get_ylim()\n", |
1591 | 1606 | "\n", |
1592 | | - " if ax_lim[0] < ax_lim[1]:\n", |
1593 | | - " contrast_lim_low, contrast_lim_high = ax_lim\n", |
| 1607 | + " if contrast_lim_low < 0 < contrast_lim_high:\n", |
| 1608 | + " ax.hlines(y=0, xmin=contrast_xlim[0], xmax=contrast_xlim[1], **reflines_kwargs)\n", |
| 1609 | + " ax.hlines(y=0, xmin=delta2_xlim[0], xmax=delta2_xlim[1], **reflines_kwargs)\n", |
1594 | 1610 | " else:\n", |
1595 | | - " contrast_lim_high, contrast_lim_low = ax_lim\n", |
| 1611 | + " ax_lim = ax.get_xlim() if horizontal else ax.get_ylim()\n", |
| 1612 | + " method = ax.axvline if horizontal else ax.axhline\n", |
| 1613 | + "\n", |
| 1614 | + " if ax_lim[0] < ax_lim[1]:\n", |
| 1615 | + " contrast_lim_low, contrast_lim_high = ax_lim\n", |
| 1616 | + " else:\n", |
| 1617 | + " contrast_lim_high, contrast_lim_low = ax_lim\n", |
1596 | 1618 | "\n", |
1597 | | - " if contrast_lim_low < 0 < contrast_lim_high:\n", |
1598 | | - " method(0, **reflines_kwargs)\n", |
| 1619 | + " if contrast_lim_low < 0 < contrast_lim_high:\n", |
| 1620 | + " method(0, **reflines_kwargs)\n", |
1599 | 1621 | "\n", |
1600 | 1622 | "def redraw_independent_spines(\n", |
1601 | 1623 | " rawdata_axes : axes.Axes,\n", |
|
0 commit comments