Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2fa96ed

Browse files
authored
Merge pull request#30109 from rcomer/petroff-styles
2 parents74ae218 +05b0a4e commit2fa96ed

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

‎galleries/examples/style_sheets/petroff10.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
2-
=====================
3-
Petroff10 stylesheet
4-
=====================
2+
====================
3+
Petroff stylesheets
4+
====================
55
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.
1111
1212
.. [1] https://arxiv.org/abs/2107.02270
1313
@@ -35,9 +35,15 @@ def image_and_patch_example(ax):
3535
c=plt.Circle((5,5),radius=5,label='patch')
3636
ax.add_patch(c)
3737

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+
4349
plt.show()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp