Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6322659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:22:27+00:00 2026-05-24T16:22:27+00:00

I want to have labels with small size on a piechart in python to

  • 0

I want to have labels with small size on a piechart in python to improve visibility
here is the code

import matplotlib.pyplot as plt

frac=[1.40 , 10.86 , 19.31 , 4.02 , 1.43 , 2.66 , 4.70 , 0.70 , 0.13 , 1.48, 32.96 , 1.11 , 13.30 , 5.86]
labels=['HO0900344', 'HO0900331', 'HO0900332', 'HO0900354', 
'HO0900358', 'HO0900374', 'HO0900372', 'HO0900373', 
'HO0900371', 'HO0900370', 'HO0900369', 'HO0900356', 
'HO0900353', 'HO0900343']

fig = plt.figure(1, figsize=(6,6))
ax = fig.add_subplot(111)
ax.axis('equal')
colors=('b', 'g', 'r', 'c', 'm', 'y', 'burlywood', 'w')
ax.pie(frac,colors=colors ,labels=labels, autopct='%1.1f%%')
plt.show()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:22:28+00:00Added an answer on May 24, 2026 at 4:22 pm

    There are a couple of ways you can change the font size of the labels.

    You can dynamically changet the rc settings. Add the following at the top of your script:

    import matplotlib as mpl
    mpl.rcParams['font.size'] = 9.0
    

    Or you can modify the labels after they have been created. When you call ax.pie it returns a tuple of (patches, texts, autotexts). As an example, modify your final few lines of code as follows:

    patches, texts, autotexts = ax.pie(frac, colors=colors, labels=labels, autopct='%1.1f%%')
    texts[0].set_fontsize(4)
    plt.show()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some labels that I want to allow users to edit. Is it
I have two labels that are stacked. If I want a horizontal line between
I have a HUD window that has some labels on it, and I want
BACKGROUND: I would like to have small labels in columns of a table. I'm
I'm creating a small win32 application. Currently I have 6 text labels coded in
Next to an input field, I want to have a small '[?]' link which
I want to make a small GUI using Tk in Perl that will have
The site is here I have opt to using the radiobutton's labels as customized
Say I have a label control in Winforms and I want to do some
I have a label like <label for=Some Feild >Some Text </label> Now I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.