Automationscribe.com
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automation Scribe
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automationscribe.com
No Result
View All Result

Visualization of Information with Pie Charts in Matplotlib | by Diana Rozenshteyn | Oct, 2024

admin by admin
October 19, 2024
in Artificial Intelligence
0
Visualization of Information with Pie Charts in Matplotlib | by Diana Rozenshteyn | Oct, 2024
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


Examples of learn how to create various kinds of pie charts utilizing Matplotlib to visualise the outcomes of database evaluation in a Jupyter Pocket book with Pandas

Diana Rozenshteyn

Towards Data Science

Photograph by Niko Nieminen on Unsplash

Whereas engaged on my Grasp’s Thesis titled “Components Related to Impactful Scientific Publications in NIH-Funded Coronary heart Illness Analysis”, I’ve used various kinds of pie charts as an example among the key findings from the database evaluation.

A pie chart could be an efficient alternative for information visualization when a dataset incorporates a restricted variety of classes representing components of an entire, making it well-suited for displaying categorical information with an emphasis on evaluating the relative proportions of every class.

On this article, I’ll exhibit learn how to create 4 various kinds of pie charts utilizing the identical dataset to offer a extra complete visible illustration and deeper perception into the information. To attain this, I’ll use Matplotlib, Python’s plotting library, to show pie chart visualizations of the statistical information saved within the dataframe. In case you are not accustomed to Matplotlib library, a great begin is Python Information Science Handbook by Jake VanderPlas, particularly chapter on Visualization with Matplotlib and matplotlib.org.

First, let’s import all the required libraries and extensions:

Subsequent, we’ll put together the CSV file for processing:

The mini dataset used on this article highlights the highest 10 journals for coronary heart illness analysis publications from 2002 to 2020 and is an element of a bigger database collected for the Grasp’s Thesis analysis. The columns “Feminine,” “Male,” and “Unknown” symbolize the gender of the primary creator of the revealed articles, whereas the “Whole” column displays the overall variety of coronary heart illness analysis articles revealed in every journal.

Picture by the creator and represents output of the Pie_Chart_Artcile_2.py pattern code above.

For smaller datasets with fewer classes, a pie chart with exploding slices can successfully spotlight a key class by pulling it out barely from the remainder of the chart. This visible impact attracts consideration to particular classes, making them stand out from the entire. Every slice represents a portion of the overall, with its dimension proportional to the information it represents. Labels could be added to every slice to point the class, together with percentages to indicate their proportion to the overall. This visible method makes the exploded slice stand out with out shedding the context of the complete information illustration.

Picture by the creator and represents output of the Pie_Chart_Artcile_3.py pattern code above.

The identical exploding slices method could be utilized to all different entries within the pattern dataset, and the ensuing charts could be displayed inside a single determine. This kind of visualization helps to spotlight the over illustration or beneath illustration of a specific class inside the dataset. Within the instance supplied, presenting all 10 charts in a single determine reveals that not one of the prime 10 journals in coronary heart illness analysis revealed extra articles authored by ladies than males, thereby emphasizing the gender disparity.

Gender distributions for prime 10 journals for coronary heart illness analysis publications, 2002–2020. Picture by the creator and represents output of the Pie_Chart_Artcile_4.py pattern code above.

A variation of the pie chart, often called a donut chart, can be used to visualise information. Donut charts, like pie charts, show the proportions of classes that make up a complete, however the heart of the donut chart can be utilized to current further information. This format is much less cluttered visually and may make it simpler to check the relative sizes of slices in comparison with an ordinary pie chart. Within the instance used on this article, the donut chart highlights that among the many prime 10 journals for coronary heart illness analysis publications, the American Journal of Physiology, Coronary heart and Circulatory Physiology revealed essentially the most articles, accounting for 21.8%.

Picture by the creator and represents output of the Pie_Chart_Artcile_5.py pattern code above.

We are able to improve the visualization of further data from the pattern dataset by constructing on the earlier donut chart and making a nested model. The add_artist() methodology from Matplotlib’s determine module is used to include any further Artist (resembling figures or objects) into the bottom determine. Just like the sooner donut chart, this variation shows the distribution of publications throughout the highest 10 journals for coronary heart illness analysis. Nonetheless, it additionally consists of a further layer that exhibits the gender distribution of first authors for every journal. This visualization highlights {that a} bigger share of the primary authors are male.

Picture by the creator and represents output of the Pie_Chart_Artcile_6.py pattern code above.

In conclusion, pie charts are efficient for visualizing information with a restricted variety of classes, as they permit viewers to shortly perceive an important classes or dominant proportions at a look. On this particular instance, using 4 various kinds of pie charts offers a transparent visualization of the gender distribution amongst first authors within the prime 10 journals for coronary heart illness analysis publications, primarily based on the 2002 to 2020 mini dataset used on this examine. It’s evident {that a} larger share of the publication’s first authors are males, and not one of the prime 10 journals for coronary heart illness analysis revealed extra articles authored by females than by males through the examined interval.

Jupyter Pocket book and dataset used for this text could be discovered at GitHub

Thanks for studying,

Diana

Word: I used GitHub embeds to publish this text.

Tags: ChartsDataDianaMatplotlibOctPieRozenshteynVisualization
Previous Post

Use Amazon SageMaker Studio with a customized file system in Amazon EFS

Next Post

Summarize name transcriptions securely with Amazon Transcribe and Amazon Bedrock Guardrails

Next Post
Summarize name transcriptions securely with Amazon Transcribe and Amazon Bedrock Guardrails

Summarize name transcriptions securely with Amazon Transcribe and Amazon Bedrock Guardrails

Leave a Reply Cancel reply

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

Popular News

  • How Aviva constructed a scalable, safe, and dependable MLOps platform utilizing Amazon SageMaker

    How Aviva constructed a scalable, safe, and dependable MLOps platform utilizing Amazon SageMaker

    401 shares
    Share 160 Tweet 100
  • Diffusion Mannequin from Scratch in Pytorch | by Nicholas DiSalvo | Jul, 2024

    401 shares
    Share 160 Tweet 100
  • Unlocking Japanese LLMs with AWS Trainium: Innovators Showcase from the AWS LLM Growth Assist Program

    401 shares
    Share 160 Tweet 100
  • Streamlit fairly styled dataframes half 1: utilizing the pandas Styler

    400 shares
    Share 160 Tweet 100
  • Proton launches ‘Privacy-First’ AI Email Assistant to Compete with Google and Microsoft

    400 shares
    Share 160 Tweet 100

About Us

Automation Scribe is your go-to site for easy-to-understand Artificial Intelligence (AI) articles. Discover insights on AI tools, AI Scribe, and more. Stay updated with the latest advancements in AI technology. Dive into the world of automation with simplified explanations and informative content. Visit us today!

Category

  • AI Scribe
  • AI Tools
  • Artificial Intelligence

Recent Posts

  • Insights in implementing production-ready options with generative AI
  • Producing Information Dictionary for Excel Information Utilizing OpenPyxl and AI Brokers
  • How Deutsche Bahn redefines forecasting utilizing Chronos fashions – Now obtainable on Amazon Bedrock Market
  • Home
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

© 2024 automationscribe.com. All rights reserved.

No Result
View All Result
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us

© 2024 automationscribe.com. All rights reserved.