• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Tuesday, July 22, 2025
newsaiworld
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
Morning News
No Result
View All Result
Home Artificial Intelligence

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

Admin by Admin
October 19, 2024
in Artificial Intelligence
0
0dn5rd0k5rwduvzyi.jpeg
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

READ ALSO

How To Considerably Improve LLMs by Leveraging Context Engineering

Exploring Immediate Studying: Utilizing English Suggestions to Optimize LLM Techniques


Examples of the way 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

Picture 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 for example a number of the key findings from the database evaluation.

A pie chart will be an efficient alternative for information visualization when a dataset comprises 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 the way to create 4 various kinds of pie charts utilizing the identical dataset to supply 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. If you’re not accustomed to Matplotlib library, 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 a component of a bigger database collected for the Grasp’s Thesis analysis. The columns “Feminine,” “Male,” and “Unknown” signify the gender of the primary creator of the revealed articles, whereas the “Whole” column displays the full 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 full, with its dimension proportional to the information it represents. Labels will be added to every slice to point the class, together with percentages to indicate their proportion to the full. This visible approach 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 approach will be utilized to all different entries within the pattern dataset, and the ensuing charts will be displayed inside a single determine. This sort of visualization helps to focus on the over illustration or below illustration of a specific class throughout the dataset. Within the instance offered, 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, referred to as a donut chart, can be used to visualise information. Donut charts, like pie charts, show the proportions of classes that make up an entire, however the middle 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 a regular 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 probably 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 will 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() technique from Matplotlib’s determine module is used to include any further Artist (equivalent to figures or objects) into the bottom determine. Much 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 contains an extra layer that reveals 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 allow viewers to shortly perceive an important classes or dominant proportions at a look. On this particular instance, using 4 various kinds of pie charts supplies a transparent visualization of the gender distribution amongst first authors within the prime 10 journals for coronary heart illness analysis publications, based mostly on the 2002 to 2020 mini dataset used on this examine. It’s evident {that a} greater 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 in the course of the examined interval.

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

Thanks for studying,

Diana

Word: I used GitHub embeds to publish this text.

Tags: ChartsDataDianaMatplotlibOctPieRozenshteynvisualization

Related Posts

Featured image 1.jpg
Artificial Intelligence

How To Considerably Improve LLMs by Leveraging Context Engineering

July 22, 2025
Cover prompt learning art 1024x683.png
Artificial Intelligence

Exploring Immediate Studying: Utilizing English Suggestions to Optimize LLM Techniques

July 21, 2025
Combopic.png
Artificial Intelligence

Estimating Illness Charges With out Prognosis

July 20, 2025
Tds header.webp.webp
Artificial Intelligence

From Reactive to Predictive: Forecasting Community Congestion with Machine Studying and INT

July 20, 2025
Conny schneider preq0ns p e unsplash scaled 1.jpg
Artificial Intelligence

The Hidden Lure of Fastened and Random Results

July 19, 2025
Dynamic solo plot my photo.png
Artificial Intelligence

Achieve a Higher Understanding of Pc Imaginative and prescient: Dynamic SOLO (SOLOv2) with TensorFlow

July 18, 2025
Next Post
Scam Alert.jpg

Crypto Rip-off Operator Sentenced to twenty Years, Ordered to Forfeit $3.6M

Leave a Reply Cancel reply

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

POPULAR NEWS

0 3.png

College endowments be a part of crypto rush, boosting meme cash like Meme Index

February 10, 2025
Gemini 2.0 Fash Vs Gpt 4o.webp.webp

Gemini 2.0 Flash vs GPT 4o: Which is Higher?

January 19, 2025
1da3lz S3h Cujupuolbtvw.png

Scaling Statistics: Incremental Customary Deviation in SQL with dbt | by Yuval Gorchover | Jan, 2025

January 2, 2025
How To Maintain Data Quality In The Supply Chain Feature.jpg

Find out how to Preserve Knowledge High quality within the Provide Chain

September 8, 2024
0khns0 Djocjfzxyr.jpeg

Constructing Data Graphs with LLM Graph Transformer | by Tomaz Bratanic | Nov, 2024

November 5, 2024

EDITOR'S PICK

Tokenize The Asset Rwas All The Way.webp.webp

The $10 Trillion Tokenization Alternative – Are You Paying Consideration?

February 5, 2025
Chip Fab Shutterstock 2 1 2145346979.jpg

Information Bytes Podcast 20250217: Arm Promoting Its Personal Chips to Meta?, Massive xAI, Massive Energy, Massive… Air pollution?, TSMC in Intel Fab Takeover?, Europe’s Massive AI Funding

February 18, 2025
Dare Map Of Participants 2 1 0325.png

Europe, Looking for HPC and AI Autonomy, Launches €240M DARE Undertaking

March 19, 2025
1ordxnff2 Dz Hddy0rmgyw.jpeg

From Principle to Observe with Particle Swarm Optimization, Utilizing Python | by Piero Paialunga | Sep, 2024

September 7, 2024

About Us

Welcome to News AI World, your go-to source for the latest in artificial intelligence news and developments. Our mission is to deliver comprehensive and insightful coverage of the rapidly evolving AI landscape, keeping you informed about breakthroughs, trends, and the transformative impact of AI technologies across industries.

Categories

  • Artificial Intelligence
  • ChatGPT
  • Crypto Coins
  • Data Science
  • Machine Learning

Recent Posts

  • I Analysed 25,000 Lodge Names and Discovered 4 Stunning Truths
  • Open Flash Platform Storage Initiative Goals to Minimize AI Infrastructure Prices by 50%
  • RAIIN will probably be out there for buying and selling!
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2024 Newsaiworld.com. All rights reserved.

No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us

© 2024 Newsaiworld.com. All rights reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?