Bioinformatics ReviewBioinformatics Review
Notification Show More
Font ResizerAa
  •  Home
  • Docking
  • MD Simulation
  • Tools
  • More Topics
    • Softwares
    • Sequence Analysis
    • Algorithms
    • Bioinformatics Programming
    • Bioinformatics Research Updates
    • Drug Discovery
    • Phylogenetics
    • Structural Bioinformatics
    • Editorials
    • Tips & Tricks
    • Bioinformatics News
    • Featured
    • Genomics
    • Bioinformatics Infographics
  • Community
    • BiR-Research Group
    • Community Q&A
    • Ask a question
    • Join Telegram Channel
    • Join Facebook Group
    • Join Reddit Group
    • Subscription Options
    • Become a Patron
    • Write for us
  • About Us
    • About BiR
    • BiR Scope
    • The Team
    • Guidelines for Research Collaboration
    • Feedback
    • Contact Us
    • Recent @ BiR
  • Subscription
  • Account
    • Visit Dashboard
    • Login
Font ResizerAa
Bioinformatics ReviewBioinformatics Review
Search
Have an existing account? Sign In
Follow US
Bioinformatics ProgrammingPython

How to create a pie chart using Python?

Dr. Muniba Faiza
Last updated: March 12, 2023 2:32 pm
Dr. Muniba Faiza
Share
1 Min Read
How to create a pie chart using Python?
SHARE

In this article. we are creating a pie chart of the docking score of five different compounds docked with the same protein.

In the following Python code, let’s store the docking scores in a variable called ‘data‘, and compound names in the ‘label‘ variable.

import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline

data = [6.3, 7.8, 6.9, 7.0, 8.5]
label = ['cmp1', 'cmp2', 'cmp3', 'cmp4', 'cmp5']

plt.pie(data, labels=label, autopct='%.0f%%', explode=[0,0,0,0,0], shadow=False, startangle=90, wedgeprops = {"alpha": 0.3})

#plt.bar(data, label, 0.1, alpha=0.5)
plt.title('Docking scores of five compounds docked with same protein')
plt.axis('equal')
plt.legend()
plt.show()

You can save this file in Python format or run it in Notebook. It will generate a pie chart as shown below:

python script to plot a pie chart


 

TAGGED:pie chartpython script
Share This Article
Facebook Copy Link Print
ByDr. Muniba Faiza
Follow:
Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

How to visualize a 3D structure using Py3Dmol?
How to visualize a 3D structure using Py3Dmol?
Bioinformatics Programming Cheminformatics GitHub Python
ai tools vs traditional tools in bioinformatics
AI Tools vs Traditional Tools in Bioinformatics- Which one to select?
Algorithms Artificial Intelligence Machine Learning Software Tools
AI vs Physics in Molecular Docking
AI vs Physics in Molecular Docking: Towards Faster and More Accurate Pose Prediction
Artificial Intelligence Drug Discovery Machine Learning
10 years of Bioinformatics Review: From a Blog to a Bioinformatics Knowledge Hub!
Editorial

You Might Also Like

wes_data_analysis Whole Exome Sequencing (WES) Data visualization Toolkit
Bioinformatics ProgrammingGitHubPython

wes_data_analysis: Whole Exome Sequencing (WES) Data visualization Toolkit

August 11, 2025
How to convert the PDB file to PSF format?
Bioinformatics ProgrammingPython

How to convert the PDB file to PSF format?

September 22, 2022
programming in php
Bioinformatics Programming

How to execute Unix/shell commands in PHP?

March 6, 2021
Bioinformatics ProgrammingPerl

How to concatenate FASTA sequences using Perl?

May 20, 2020
Copyright 2024 IQL Technologies
  • Journal
  • Customer Support
  • Contact Us
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
  • Sitemap
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?

Not a member? Sign Up