Commit 6e52461
committed
BUG: Deepcopy the plot saved as last_plot
plot_context stored the in-progress plot via a shallow copy, so the
object returned by last_plot() shared mutable nested state (e.g. the
theme) with the plot being built. Building mutated that shared state,
leaving last_plot() referencing a half-built plot.
As a result, code like
last_plot() + labs(subtitle="ab")
failed to left-align the title, because the title's alignment had
already been altered in the shared state during the previous build.
Use deepcopy so last_plot() is an independent, pristine snapshot.1 parent 0614d19 commit 6e52461
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
0 commit comments