饼图

import matplotlib.pyplot as plt

# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral']
explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True, startangle=90) # Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal') plt.savefig('D:\\pie.png')
plt.show()

结果

python matplotlib 绘图的更多相关文章

  1. Python Matplotlib绘图基础

    Matplotlib绘图基础 1.Figure和Subplot import numpy as np import matplotlib.pyplot as plt #创建一个Figure fig = ...

  2. python matplotlib 绘图基础

    在利用Python做数据分析时,探索数据以及结果展现上图表的应用是不可或缺的. 在Python中通常情况下都是用matplotlib模块进行图表制作. 先理下,matplotlib的结构原理: mat ...

  3. Python matplotlib绘图学习笔记

    测试环境: Jupyter QtConsole 4.2.1Python 3.6.1 1.  基本画线: 以下得出红蓝绿三色的点 import numpy as npimport matplotlib. ...

  4. 【划重点】Python matplotlib绘图建立画布和坐标系

    一.建立画布 import matplotlib.pyplot as plt import numpy as np x=np.arange(8) y=np.arange(8) print(x,y) # ...

  5. 吴裕雄 python matplotlib 绘图示例

    import matplotlib.pyplot as plt plt.scatter([1,2,3,4],[2,3,2,5])plt.title('My first plot')plt.show() ...

  6. python matplotlib绘图

    import numpy as np import matplotlib.pyplot as plt from scipy.constants.constants import alpha from ...

  7. python matplotlib 绘图 和 dpi对应关系

    dpi=1 600×400 dpi=2 1200×800 dpi=3 1800×1200 ........ dpi=21 (21×600)×(21×400) ---> 12600×8400 示例 ...

  8. python matplotlib绘图/sklearn包--make_blobs()

    1.make_bolbs() 函数 from sklearn.datasets.samples_generator import make_blobs import numpy as np impor ...

  9. python matplotlib绘图大全(散点图、柱状图、饼图、极坐标图、热量图、三维图以及热图)

    //2019.7.14晚matplotlib七种常见图像输出编程大全 七种图形汇总输出如下: import numpy as np #导入数据结构nmupy模块import matplotlib.py ...

随机推荐

  1. Sqlmap注入技巧集锦

    当我们注射的时候,判断注入 http://site/script?id=10 http://site/script?id=11-1 # 相当于 id=10 http://site/script?id= ...

  2. 【转】在.Net中关于AOP的实现

    原文地址:http://www.uml.org.cn/net/201004213.asp 一.AOP实现初步 AOP将软件系统分为两个部分:核心关注点和横切关注点.核心关注点更多的是Domain Lo ...

  3. Apache Spark源码走读之13 -- hiveql on spark实现详解

    欢迎转载,转载请注明出处,徽沪一郎 概要 在新近发布的spark 1.0中新加了sql的模块,更为引人注意的是对hive中的hiveql也提供了良好的支持,作为一个源码分析控,了解一下spark是如何 ...

  4. 【转载】wireshark:no interface can be used for capturing in this system with the current configuration

    转自:wireshark:no interface can be used for capturing in this system with the current configuration 通过 ...

  5. Javascript 笔记与总结(1-1)作用域

    以语言的角度学习 Js 的底层原理(与 DOM 无关):① 作用域链 ② 词法分析 ③ 闭包 ④ 面向对象(原型链) ① 作用域链 例1 <script> var c = 5; funct ...

  6. java字符串练习题

  7. python 使用多线程进行压力测试

    #coding=utf-8 import urllib2 import threading import time TOTAL = 0 #总数 SUCC = 0 #响应成功数 FAIL = 0 #响应 ...

  8. MySQL解压版安装配置

    官网下载地址:http://dev.mysql.com/downloads/windows/installer/ (可以选择解压版zip下载,也可以选择msi安装版.) 解压zip版配置: 1. 下载 ...

  9. MZhong's Resume

    MATTHEW.ZHONG Male,27 Age Front-End Developer matthew.zhong@morningstar.com OBJECTIVE My objective i ...

  10. xenserver+starwind架构布署

    主机 CPU 和主板均需支持 INTER-VT/ AMD-VT ,主板默认可能没开  进BISO开启  下载最新的 xenserver ,授权注册一下 轻松得到授权文件 (鄙视一下VMWARE,看人家 ...