Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk2 min

How to Add Hatch Patterns to a Matplotlib Pie Chart

Use Matplotlib's hatch argument to apply a shared pattern or assign distinct patterns to pie-chart slices. Learn the supported syntax, version requirement, and renderer caveats.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pass the hatch argument to Axes.pie() or pyplot.pie(). Use one string to repeat a pattern across the wedges, or a list of strings to give slices distinct patterns. Pie-chart hatching requires Matplotlib 3.7 or later.

Apply a hatch to every slice or choose one per slice

The hatch parameter accepts a string or a sequence of strings. A single string applies the same pattern to all wedges; a sequence cycles through its patterns in slice order. For a different hatch on each slice, make the sequence match the order of the values.

import matplotlib.pyplot as plt

labels = ['A', 'B', 'C', 'D']
values = [15, 30, 45, 10]
hatches = ['**O', 'oO', 'O.O', '.||.']

fig, ax = plt.subplots()
ax.pie(values, labels=labels, hatch=hatches)
plt.show()

This follows the list-based approach in Matplotlib’s pie chart gallery. You can also use a shorter sequence of patterns; Matplotlib cycles through it for the wedges.

fig, ax = plt.subplots()
ax.pie([15, 30, 45, 10], hatch=['/', 'x', '.', 'o'])

The pie API also provides arguments such as labels, colors, autopct, startangle, wedgeprops, and normalize. Hatching is independent of these options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Growth Chart Stencil, 7 Feet Kids Height Ruler Template (7 PCS)
  • Premium Quality Material: Made with PET plastic material that is smooth without burr and not easy to break, ensuring durability for repeated use
  • Precise Measurements: Each chart ruler stencil measures 12 x 6 inch, with No.1 Chart designed longer than others to ensure consistent scale gaps after splicing together
  • Versatile Application: Suitable for painting and spraying on wood surfaces, allowing you to create DIY French country home decor and rustic farmhouse decorations
  • Create Custom Growth Charts: Design and build your own 7 feet wooden growth chart ruler to track your children's height milestones over the years
  • DIY Home Decor Tool: Helpful stencil set for creating rustic farmhouse decor pieces for your home, or as handmade gifts for friends and family

Choose and combine hatch patterns

Matplotlib’s hatch characters include /, \, |, -, +, x, o, O, ., and *. Combine characters for more varied textures—for example, /o or x*. Repeating a character makes the pattern denser, so // is denser than /. See the hatch style reference for examples.

For a backslash hatch, use a raw string or escape the backslash in a regular Python string:

Rank #2
Mr. Pen- Circle Template, 2 Pack, Measuring Geometry Ruler
  • Mr. Pen circle template set includes 2 geometry rulers with assorted circles, squares, triangles, hexagons, and measurement markings for drawing, drafting, and school projects.
  • Made from lightweight, translucent plastic, the templates allow users to see the paper beneath while positioning shapes and measurements accurately.
  • Multiple circle diameters and geometric cutouts provide convenient options for creating diagrams, patterns, technical drawings, charts, and craft designs.
  • Built-in centimeter rulers and clearly printed size markings help simplify measuring, spacing, and selecting the appropriate shape for each project.
  • Suitable for students, teachers, artists, architects, designers, and hobbyists, these reusable templates are practical for classrooms, offices, studios, and home use.
hatches = [r'\', '\\']

The raw string represents one backslash; the ordinary string represents two. Without escaping, Python may interpret backslashes as part of a string escape rather than the hatch pattern you intended.

Make the patterns readable

Use patterns that look different from one another when readers need to distinguish slices without relying on color. Check the chart at its final display or print size: dense hatches can become difficult to tell apart when wedges are small. These are design choices rather than a fixed Matplotlib readability rule.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Talisman Designs Shortcrust Pastry Pie Hack 4-14 Inch Professional Pie Stencil - Perfect Circular Dough Cutting Tool (Set of 1 Pie Pastry Guide)
  • PIE PERFECTION: Pie crust design becomes a breeze with the Talisman Designs Pie Pastry Guide, a tool that revolutionizes the baking process for novices and experts alike. As a pie crust shaper, it eliminates the guesswork and frustration often associated with rolling out pie dough, ensuring your crust is always the right size and a perfect circle.
  • VERSATILE TOOL: Talisman Designs has created a versatile tool that opens up a world of baking possibilities. Acting as a pie crust cutter, it works with pie dough, puff pastry, fondant, parchment paper, and more, allowing you to experiment with a variety of sweet and savory pies and pastries.
  • MEASUREMENT GRAPHICS: This pastry guide features fun retro graphics that clearly display measurements, allowing you to adjust the size of your pie crusts with ease. As part of your baking supplies, it lets you cut perfect circles from 4 to 14 inches, whether you're making a full-size pie or individual servings, adding a touch of whimsy to your baking process.
  • EASY CUTTING: This tool is designed to be placed in the center of the dough for easy cutting, allowing you to focus more on the joy of baking. It's an easy-to-use circle guide that lets you spend less time worrying about the technicalities and more time enjoying the baking process.
  • DURABLE & CONVENIENT: You'll appreciate the durability and convenience of this baking guide, made of BPA-free food safe silicone and plastic. It's easy to hand wash or suitable for the top rack of the dishwasher, ensuring the longevity of the tool and simplifying the cleaning process, so you can spend more time entertaining friends and family.

Each slice is a Wedge patch. To adjust properties such as the edge line width or color, pass them with wedgeprops; the gallery also notes that individual wedge objects can be customized.

fig, ax = plt.subplots()
ax.pie(
    [15, 30, 45, 10],
    hatch=['/', 'x', '.', 'o'],
    wedgeprops={'linewidth': 1, 'edgecolor': 'black'},
)
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the Matplotlib version and renderer

The hatch parameter for pie charts was added in Matplotlib 3.7. On an older version, this direct argument is unavailable; check the installed version before using the example in an environment that must support older releases.

Rank #4
12 Pieces Stencil for Artisan Bread Baking Set Cook Stencil Baking Template Bread, Cake, Pie, or Cookie Stencils Template Mold for Decorating, 12 Styles
  • 1.Package: one package includes 12 styles baking stencils in total, include [Baked WITH love], [Happy Birthday], star, flower, leaves and so on, enough quantity for meeting various demands; Size: each individual stencil is 5.9 x 5.9 inches
  • 2.Create more fun: you use use these Artisan bread stencils to add extra design element to your artisan bread loaves and baked goods, easy to make delicate bread surface and turn a simple loaf into a work of art, bring good mood when eating
  • 3.Convenient to use: you just need to place this bread stencil on a flat and clean surface, then use a brush or icing to paint on the objects that you want to decorate, then you can peel off your template and get your craft, make more beautiful baking items and save your effort
  • 4.Safe and durable: our cook stencil molds are made of PET material, which has good durability and flexibility, washable and reusable, reduce your washing time after use, great for airbrushing and icing on many different surfaces, such as baked goods and other goods
  • 5.Where to use: these baking stencil molds are suitable for applying to many baking projects, including bread, cakes, cookies, pies and so on, you can also use the baking templates for more than just your baking needs, ideal for various DIY projects like drawing, art journals and home decor

Hatch rendering depends on the backend. The current Matplotlib hatch documentation lists PS, PDF, SVG, macOS, and Agg as supported, and says WX and Cairo do not currently support hatching. If patterns appear in one output but not another, check which backend is producing that output. The hatch demo shows hatching across supported output formats.

There is also a separate return-value change in the current Matplotlib 3.11 API: pie() returns a PieContainer; earlier versions returned wedges and text objects as a tuple. This does not change how to pass hatch, but it can affect code that unpacks the return value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Tamaki Circle Template Circle Round Stencil Templates for Drafting for Office and School Building Formwork Drawings Templates, Large and Small Size, 3 Pack
  • 3 pack circle drawing templates can drawing patterns like different sizes of circle, which are handy drawing helpers.
  • This circle stencil are made of quality plastic, which is durable and long-lasting, not easy to break, convenient for you to use in daily life.
  • Drawing rulers cover a very wide range of styles and sizes.They're super clear to draw through the rulers.You can do brief quick sketch, drafting, doodle, artwork, drawing, design projects.
  • Circle template drawing tool is very convenient to carry and meet your different needs for daily usages.
  • These templates good for architecture, mathematics, network technique, fractional measurement, art design and school learning.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.