Commit 208068e
committed
Give each inset its own zorder band
Sibling insets all received the same _zorder (host._zorder +
INSET_ZORDER_STEP), so their figure-level artists collided inside one
band: an earlier inset's panel_border, titles, axis titles and legend
sat above a later inset's panel because they had larger numeric zorders
than the panel itself. The "later inset fully covers earlier" intent
only held for the panel area, where equal-zorder ties broke by
insertion order.
inset_element._setup now takes the 1-based index among its siblings
and assigns _zorder = parent._zorder + index * INSET_ZORDER_STEP, so
each inset occupies its own band. Insets._setup enumerates and passes
the index through.
INSET_ZORDER_STEP shrinks from 1000 to 10 now that nothing inside a
single plot reaches 99.9 anymore: watermark drops from 99.9 to 9, and
the explicit zorder=99.1 on the legend's FlexibleAnchoredOffsetbox is
removed (the mpl default of 5 is already above all decorations and
below the watermark, and ggplot._add_figure_artist offsets it into the
right band). The 0.5 gap between an inset's watermark (band top) and
the next inset's plot_background (band bottom, -0.5) is the tightest
the geometry permits and is safe — no other artist falls in it.1 parent 59a341b commit 208068e
3 files changed
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | | - | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | | - | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | | - | |
109 | | - | |
| 115 | + | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
0 commit comments