• 012_饼图


    import pandas as pd
    import matplotlib.pyplot as plt
    
    
    if __name__ == '__main__':
        student = pd.read_excel("C:/Users/123/Desktop/pandas/012_饼图/Students.xlsx")
        print(student.head)
    
        student = student.set_index("From")    # 设置标签
        # 逆时针
        # student["2017"].sort_values(ascending = True).plot.pie(fontsize = 8)    # 逆时针
        student["2017"].plot.pie(fontsize = 8, counterclock = False, startangle = -270)  # 逆时针
    
        # 顺时针
        # student["2017"].sort_values(ascending = True).plot.pie(fontsize = 8, startangle = -270)    # 顺时针
        # student["2017"].plot.pie(fontsize = 8, counterclock = False)  # 逆时针
    
        plt.title("Source of international Students", fontsize = 16, fontweight = "bold")
        plt.ylabel("2017", fontsize = 12, fontweight = "bold")
        plt.show()
  • 相关阅读:
    拯救公主
    爱情之路
    无聊的会议
    对拍检验程序
    TCP三次握手
    OA系统走过的的坑之部门岗位管理
    蓝屏警告
    三级联动
    Ajax二级联动
    近期疑惑和总结
  • 原文地址:https://www.cnblogs.com/huafan/p/14409604.html
Copyright © 2020-2023  润新知