Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Creating a donut plot python

import matplotlib.pyplot as plt
import numpy as np
colors = sns.color_palette('pastel')
plt.pie(data, labels = label_column, colors=colors)
circle = plt.Circle( (0,0), 0.7, color='white') #removing the center part of the pie graph
p=plt.gcf() #get coded figure (line 3 and 4)
p.gca().add_artist(circle)  #grab line 5
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: python sum of list 
Python :: dataframe select columns based on list 
Python :: distplot in python 
Python :: django get_user_model() function 
Python :: python filter dict 
Python :: find max value in list python 
Python :: notna pandas 
Python :: python negative indexing 
Python :: python put console window on top 
Python :: seaborn Using the dark theme python 
Python :: pandas merge two columns from different dataframes 
Python :: how to print keys and values of dictionary together in python? 
Python :: list comprehension if elseif 
Python :: os.execl 
Python :: round list python 
Python :: change float column to percentage python 
Python :: python remove blanks from string 
Python :: python fractions 
Python :: prevent division by zero numpy 
Python :: how to take multiple line inputs in python 
Python :: root.iconbitmap 
Python :: in dataframe particular column to string 
Python :: pathlib path of current file 
Python :: python test if list of dicts has key 
Python :: python join list ignore none and empty string 
Python :: how to create new header of a dataframe in python 
Python :: python how to find circumference of a circle 
Python :: keras maxpooling1d 
Python :: how to check a phone number is valid in python 
Python :: delete column in dataframe pandas 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =