Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pie plot chance size python

import matplotlib.pyplot as plt

sizes = [15, 30, 45, 10, 10, 24, 13, 18, 28, 20, 13, 15, 5, 1, 18, 10,
         10, 10]
labels = ["Frogs %s" % i for i in sizes]

fig1, ax1 = plt.subplots(figsize=(6, 5))
fig1.subplots_adjust(0.3,0,1,1)


theme = plt.get_cmap('bwr')
ax1.set_prop_cycle("color", [theme(1. * i / len(sizes)) for i in range(len(sizes))])

_, _ = ax1.pie(sizes, startangle=90)

ax1.axis('equal')

total = sum(sizes)
plt.legend(
    loc='upper left',
    labels=['%s, %1.1f%%' % (
        l, (float(s) / total) * 100) for l, s in zip(labels, sizes)],
    prop={'size': 11},
    bbox_to_anchor=(0.0, 1),
    bbox_transform=fig1.transFigure
)

plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: tornado cookies authorization 
Python :: no repetir elementos en una lista python 
Python :: encrypt 
Python :: In interactive mode, the last printed expression is assigned to the variable _ 
Python :: does xgboost accept pandas 
Python :: Top n rows of each group 
Python :: PyQgis Spatial join y attribute 
Python :: non linear regression 
Python :: using deque to make a list 
Python :: Qt spinning box 
Python :: python regex compile 
Python :: set layer start and end time arcpy 
Python :: sample regression algorithm using pipeline with hyperparameter tuning 
Python :: find anagrams of a string python 
Python :: what is PaasLib 
Python :: python kivy black screen 
Python :: remove variables withouth variance python 
Python :: How to Embed a plotly chart in html document 
Python :: trivia python game 
Python :: tkinder 
Python :: Add value on top of each bar using function 
Python :: Pandas: Ternary conditional operator for setting a value in a DataFrame 
Python :: how to create a sub project in django 
Python :: trends in yearly data python 
Python :: van first name van second name van last name 
Python :: uppy tus 
Python :: expionenttiation python 
Python :: load local data to django 
Python :: autoencoder for classification keras 
Python :: django BruteBuster error failed attempts 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =