Commit 8e2f62a
committed
Fix pickling of axes property cycle.
Instead of relying on itertools.cycle (which is unpicklable, and leads
to the axes property cycle being reset to the rcparams value upon
unpickling), use a plain, trivially picklable, list-and-index
representation (the property cycle is guaranteed to be finite because
Axes.set_prop_cycle passes its argument through matplotlib.cycler, which
already iterates through all cycler values for validation purposes).
Unfortunately this is not enough to really get rid of the
get_next_color/get_next_color_func awkwardness, which also serves the
additional purpose of not unnecessarily advancing the prop_cycle when it
does not contain a "color" key and a color is requested.1 parent 2a4d905 commit 8e2f62a
File tree
4 files changed
+33
-19
lines changed- lib/matplotlib
- axes
- tests
4 files changed
+33
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 226 | | |
236 | 227 | | |
237 | 228 | | |
238 | | - | |
| 229 | + | |
| 230 | + | |
239 | 231 | | |
240 | 232 | | |
241 | 233 | | |
| |||
315 | 307 | | |
316 | 308 | | |
317 | 309 | | |
318 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
319 | 313 | | |
320 | 314 | | |
321 | 315 | | |
| |||
328 | 322 | | |
329 | 323 | | |
330 | 324 | | |
331 | | - | |
| 325 | + | |
| 326 | + | |
332 | 327 | | |
333 | 328 | | |
334 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 133 | | |
128 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
129 | 138 | | |
130 | | - | |
131 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
0 commit comments