plt.fill_between用法
plt.fill_between用颜色填充两条曲线之间的区域
plt.fill_between(x, y1, y2),其中x是横坐标,y1和y2是两条曲线,这个函数的作用是用颜色填充y1和y2这两条曲线之间的区域。
该函数最常用的用法是已知均值曲线和标准差,画出标准差覆盖的区域,例如下面这个例子:
已知在一个回归问题中,输入向量是x,通过多次试验得到了输出的均值和标准差分别为y_mean和y_std,y_mean和y_std均为向量。现需画出一倍方差和二倍方差覆盖的区域,代码如下:
for i in range(2):plt.fill_between(x,y_mean - y_std * ((i+1.)),y_mean + y_std * ((i+1.)),color="b",alpha=0.1)
plt.legend()
plt.grid()
得到下图中的蓝色曲线和蓝色填充区域
plt.fill_between用法相关推荐
- meshgrid()+plt.contourf()用法
这次在matplotlib画图时遇到了这两个函数,感觉有必要看看怎么用,就自己尝试找找文档稍微记一下关键使用 np.meshgrid() numpy.meshgrid(*xi, copy=True, ...
- plt.axis()用法详解
plt.axis('square') 作图为正方形,并且x,y轴范围相同,即y m a x − y m i n = x m a x − x m i n y_{max}-y_{min} = x_{max ...
- matplotlib.plt.subplot()用法
在matplotlib下,一个Figure对象可以包含多个子图(Axes),可以使用subplot()快速绘制,其调用形式如下: subplot(numRows, numCols, plotNum) ...
- plt.text()用法
matplotlib.pyplot.text(x, y, s, fontdict=None, withdash=False, **kwargs) x,y:位置(position) s:该positio ...
- plt.plot用法
plt.plot(x, y, format_string, **kwargs) 参数 说明 x X轴数据,列表或数组,可选 y Y轴数据,列表或数组 format_string 控制曲线的格式字符串, ...
- plt.subplot()用法
subplot(nrows, ncols, plot_number) 或者写成subplot(nrows ncols plot_number)也行 这个很随意 哈哈 这个函数用来表示把figure分成 ...
- plt.subplot 用法
#! /user/bin/env python #_*_coding:utf-8 -*_ #__author__ = '易美智能工程有限责任公司' #Email:yizhi8.@qq.com impo ...
- high sierra镜像_在High Sierra升级后修复git
high sierra镜像 Every major operating system upgrade is a grand adventure. No matter the vendor or ho ...
- matplotlib入门之plt.plot折线图跟常用基本函数
目录 一.简单折线图 二.常用基本函数:plt.xticks,plt.yticks,ply.xlim,plt.ylim,plt.xlabel,plt.ylabel,plt.title,plt.lege ...
最新文章
- Codeforces Gym 100418K Cards 暴力打表
- 一步快速将Smartform output转成生成PDF文件
- 4 weekend110的hdfs下载数据源码跟踪铺垫 + hdfs下载数据源码分析-getFileSystem(值得反复推敲和打断点源码)...
- C#= 栈模仿堆的操作
- java怎样写入五个人的成绩_用java输入5个学员姓名和分数,显示分数最高的学员姓名和分数?...
- 从0开始学习自动化测试框架cypress(四)登录
- mysql 表 区 块 页_数据库 | 001-MySQL梳理系列(一)
- RTF文件格式【转】
- Android adb “push pull”中文支持解决方案
- from pristine store, because no checksum is recorded for this file
- Android 系统签名jks文件获取platform.jks
- ie浏览器服务器无响应怎么办,ie浏览器无响应怎么办
- pda通用扫描app_手持终端PDA盘点机盘点软件盘点APP
- 汽车CAN诊断——报文数据篇
- magicbook的linux是哪个版本,荣耀MagicBook 2019预装Linux 影响使用吗
- 深入理解Spring框架的作用
- GIS矢量数据更新时的瓦片范围计算
- 对技术的态度/编程修养(上)
- 《挑战程序设计竞赛》 读后感(转载)
- 卜若的代码笔记-unityshader系列-第十七章:Shader练习.遮罩(Shader采样Image的Sprite)