Skip to content

Allow option to display absolute values for pie chart #19338

Closed

Description

@darkdragon-001

Problem

I would like to show a label displaying the absolute numbers used to create the pie chart. Currently, only percentage labels are supported via autopct. Hacky solutions like https://stackoverflow.com/a/48299798/3779655 or https://stackoverflow.com/a/41089685/3779655 exist to retrieve the absolute values based from the fractional ones. It would be better to support it out of the box.

Proposed Solution

Add option wedgelabels=None|'percent'|'absolute'|list of strings together with wedgelabelfmt replacing autopct.

For migration, initialize wedgelabelfmt=autopct for wedgelabels='percent' and overwrite if wedgelabelfmt is set.

Activity

  1. timhoffm commented on Jan 22, 2021

    @timhoffm
    Member

    While at it, wedgelabels could also accept a list of strings.

  2. github-actions commented on Sep 29, 2023

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  3. rcomer commented on Sep 29, 2023

    @rcomer
    Member

    I found myself wanting this recently.

  4. added this to the v3.11.0 milestone on Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions