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)

運行:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章