|
1 | 1 | """
|
2 |
| -===================== |
3 |
| -Petroff10 stylesheet |
4 |
| -===================== |
| 2 | +==================== |
| 3 | +Petroff stylesheets |
| 4 | +==================== |
5 | 5 |
|
6 |
| -This example demonstrates the "petroff10" style, whichimplements the10-color |
7 |
| -sequencedeveloped by Matthew A. Petroff [1]_ for accessible data visualization. |
8 |
| -Thestyle balances aesthetics with accessibility considerations, making it |
9 |
| -suitable for various types of plots while ensuring readability and distinction |
10 |
| -between data series. |
| 6 | +This example demonstrates the "petroffN" styles, whichimplement the6-, 8- and |
| 7 | +10-color sequencesdeveloped by Matthew A. Petroff [1]_ for accessible data |
| 8 | +visualization.Thestyles balance aesthetics with accessibility considerations, |
| 9 | +making themsuitable for various types of plots while ensuring readability and |
| 10 | +distinctionbetween data series. |
11 | 11 |
|
12 | 12 | .. [1] https://arxiv.org/abs/2107.02270
|
13 | 13 |
|
@@ -35,9 +35,15 @@ def image_and_patch_example(ax):
|
35 | 35 | c=plt.Circle((5,5),radius=5,label='patch')
|
36 | 36 | ax.add_patch(c)
|
37 | 37 |
|
38 |
| -plt.style.use('petroff10') |
39 |
| -fig, (ax1,ax2)=plt.subplots(ncols=2,figsize=(12,5)) |
40 |
| -fig.suptitle("'petroff10' style sheet") |
41 |
| -colored_lines_example(ax1) |
42 |
| -image_and_patch_example(ax2) |
| 38 | + |
| 39 | +fig=plt.figure(figsize=(6.4,9.6),layout='compressed') |
| 40 | +sfigs=fig.subfigures(nrows=3) |
| 41 | + |
| 42 | +forstyle,sfiginzip(['petroff6','petroff8','petroff10'],sfigs): |
| 43 | +sfig.suptitle(f"'{style}' style sheet") |
| 44 | +withplt.style.context(style): |
| 45 | +ax1,ax2=sfig.subplots(ncols=2) |
| 46 | +colored_lines_example(ax1) |
| 47 | +image_and_patch_example(ax2) |
| 48 | + |
43 | 49 | plt.show()
|