python笔记:5.3.6_基本统计图形_饼图

 

# -*- coding: utf-8 -*-
"""
Created on Sun Jun  9 15:56:53 2019

@author: User
"""

import numpy as np
import pandas as pd

# 以下使用pandas
piedf=pd.DataFrame({'percent of position':[0.7707,0.0573,0.1720]},
                    index=['employee','director','manager'])

piedf['percent of position'].plot.pie(autopct='%1.2f', 
     labeldistance=1.2,
     fontsize=10, 
     figsize=(6, 6),
     shadow=True,
     startangle=45)

运行:

python笔记:5.3.6_基本统计图形_饼图_第1张图片

你可能感兴趣的:(python学习)