|
13 | 13 | TextJustifier, |
14 | 14 | get_subplotspecs, |
15 | 15 | rel_position, |
| 16 | + resize_footer_background, |
| 17 | + resize_footer_line, |
16 | 18 | ) |
17 | 19 |
|
18 | 20 | if TYPE_CHECKING: |
@@ -395,8 +397,21 @@ def _move_artists(self, spaces: PlotSideSpaces): |
395 | 397 | justify.horizontally_about( |
396 | 398 | self.plot_footer, ha, plot_footer_position |
397 | 399 | ) |
398 | | - self._resize_plot_footer_background(spaces) |
399 | | - self._resize_plot_footer_line(spaces) |
| 400 | + if self.plot_footer_background: |
| 401 | + resize_footer_background( |
| 402 | + self.plot_footer_background, |
| 403 | + x=spaces.l.offset, |
| 404 | + y=spaces.b.offset, |
| 405 | + height=spaces.b.footer_height, |
| 406 | + width=spaces.plot_width, |
| 407 | + ) |
| 408 | + if self.plot_footer_line: |
| 409 | + resize_footer_line( |
| 410 | + self.plot_footer_line, |
| 411 | + x=spaces.l.offset, |
| 412 | + width=spaces.plot_width, |
| 413 | + y=spaces.b.offset + spaces.b.footer_height, |
| 414 | + ) |
400 | 415 |
|
401 | 416 | if self.axis_title_x: |
402 | 417 | ha = theme.getp(("axis_title_x", "ha"), "center") |
@@ -532,31 +547,6 @@ def _strip_text_y_background_equal_widths(self): |
532 | 547 | for text, scale in zip(self.strip_text_y, relative_widths): |
533 | 548 | text.patch.expand = scale |
534 | 549 |
|
535 | | - def _resize_plot_footer_background(self, spaces: PlotSideSpaces): |
536 | | - """ |
537 | | - Resize the plot footer to the size of the footer |
538 | | - """ |
539 | | - if not self.plot_footer_background: |
540 | | - return |
541 | | - |
542 | | - self.plot_footer_background.set_x(spaces.l.offset) |
543 | | - self.plot_footer_background.set_y(spaces.b.offset) |
544 | | - self.plot_footer_background.set_height(spaces.b.footer_height) |
545 | | - self.plot_footer_background.set_width(spaces.plot_width) |
546 | | - |
547 | | - def _resize_plot_footer_line(self, spaces: PlotSideSpaces): |
548 | | - """ |
549 | | - Resize the footer line to be a border above the footer |
550 | | - """ |
551 | | - if not self.plot_footer_line: |
552 | | - return |
553 | | - |
554 | | - x1 = spaces.l.offset |
555 | | - x2 = x1 + spaces.plot_width |
556 | | - y1 = y2 = spaces.b.offset + spaces.b.footer_height |
557 | | - self.plot_footer_line.set_xdata([x1, x2]) |
558 | | - self.plot_footer_line.set_ydata([y1, y2]) |
559 | | - |
560 | 550 |
|
561 | 551 | def _text_is_visible(text: Text) -> bool: |
562 | 552 | """ |
|
0 commit comments