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

DOC: expand petroff10 example to include 6- and 8- styles#30109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:mainfromrcomer:petroff-styles
May 26, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletionsgalleries/examples/style_sheets/petroff10.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
"""
=====================
Petroff10 stylesheet
=====================
====================
Petroff stylesheets
====================

This example demonstrates the "petroff10" style, whichimplements the10-color
sequencedeveloped by Matthew A. Petroff [1]_ for accessible data visualization.
Thestyle balances aesthetics with accessibility considerations, making it
suitable for various types of plots while ensuring readability and distinction
between data series.
This example demonstrates the "petroffN" styles, whichimplement the6-, 8- and
10-color sequencesdeveloped by Matthew A. Petroff [1]_ for accessible data
visualization.Thestyles balance aesthetics with accessibility considerations,
making themsuitable for various types of plots while ensuring readability and
distinctionbetween data series.

.. [1] https://arxiv.org/abs/2107.02270

Expand DownExpand Up@@ -35,9 +35,15 @@ def image_and_patch_example(ax):
c = plt.Circle((5, 5), radius=5, label='patch')
ax.add_patch(c)

plt.style.use('petroff10')
fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(12, 5))
fig.suptitle("'petroff10' style sheet")
colored_lines_example(ax1)
image_and_patch_example(ax2)

fig = plt.figure(figsize=(6.4, 9.6), layout='compressed')
sfigs = fig.subfigures(nrows=3)

for style, sfig in zip(['petroff6', 'petroff8', 'petroff10'], sfigs):
sfig.suptitle(f"'{style}' style sheet")
with plt.style.context(style):
ax1, ax2 = sfig.subplots(ncols=2)
colored_lines_example(ax1)
image_and_patch_example(ax2)

plt.show()

[8]ページ先頭

©2009-2025 Movatter.jp