Commit 9dc3152
committed
Inherit figure_size/dpi onto insets and Compose items
An inset_element's `obj` and a Compose's items share the parent's
matplotlib figure, but their own theme.figure_size and dpi default
independently. That caused the inset's `figure_size` themeable to
resize the host figure, the inset's dpi to leak into rcParams during
its draw context, and layout sites (`_plot_side_space`,
`_composition_side_space`, `margin.setup`) to read inconsistent
values.
A new `theme._inherit_figure_props` method copies these
figure-owner-only values from a parent theme. inset_element._setup
calls it on the inset's theme; Compose.draw calls it on every item
alongside the existing zorder propagation. Nested cases compose by
recursion.1 parent 208068e commit 9dc3152
3 files changed
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
554 | | - | |
555 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
556 | 558 | | |
557 | 559 | | |
| 560 | + | |
558 | 561 | | |
559 | 562 | | |
560 | 563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
475 | 489 | | |
476 | 490 | | |
477 | 491 | | |
| |||
0 commit comments