![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
matplotlib
matplotlib
kelly old uncle
不会打代码的摄影师不是好销售
展开
-
matplotlib饼图pie
import matplotlib.pyplot as pltsizes = [1,2,3,4,5]labels = 'a','b','c','d','e'explode = (0,0,0,0.1,0)plt.pie(sizes,labels = labels,radius = 1.2,explode = explode,autopct = '%.1f%%',shadow = True,startangle = 90)#radius半径/explode距离/autopct显示占比/shadow默.原创 2021-06-05 17:03:36 · 187 阅读 · 0 评论 -
matplotlib快速参考
转载 2021-01-27 17:47:22 · 68 阅读 · 0 评论 -
matplotlib 之柱状图/条形图(bar/barh)
#导入库import matplotlib.pyplot as pltimport numpy as np#数据np.random.seed(1)#生成随机数种子 使生成hig值不变n = 10x = np.arange(n)hig = np.random.random(n)#绘图(柱状图)plt.bar(x,hig,facecolor = '#00FF00',alpha = 0.5)#x,y必不可少for i in range(n): plt.text(x[i],hig[原创 2020-10-19 16:56:20 · 484 阅读 · 0 评论 -
matplotlib数据可视化实验报告1(最终版)
import matplotlib.pyplot as plt# 创建绘图对象figure,设置画布大小figsize,分辨率dpi,背景颜色facecolor可以用十六进制颜色代码fig=plt.figure(figsize=(6,6),dpi=100,facecolor='#dfd7d7')#划分子图axax=fig.add_subplot(1,1,1)import numpy as npx = np.linspace(-3,3,100)y = np.random.randn(100)#原创 2020-10-19 16:13:15 · 8063 阅读 · 1 评论