当前位置:网站首页>置信区间的画法
置信区间的画法
2022-07-04 21:14:00 【小蜗笔记】
err_inter = result.conf_int()
#置信区间的中心
err_mean = (err_inter[1]+err_inter[0])/2
# 置信区间的长度
err_long = (err_inter[1]-err_inter[0])/2
#置信区间画图
import matplotlib.pyplot as plt
from scipy import stats
import numpy as np
plt.style.use('seaborn-whitegrid')
fig, ax = plt.subplots(figsize=(50, 20),dpi=60)
ax.spines['bottom'].set_linewidth('2.0')#设置边框线宽为2.0
ax.spines['bottom'].set_color('black')
ax.spines['top'].set_linewidth('2.0')#设置边框线宽为2.0
ax.spines['top'].set_color('black')
ax.spines['right'].set_linewidth('2.0')#设置边框线宽为2.0
ax.spines['right'].set_color('black')
ax.spines['left'].set_linewidth('2.0')#设置边框线宽为2.0
ax.spines['left'].set_color('black')
plt.xticks(fontsize = 50)
plt.yticks(fontsize = 50)
for i in range(1,len(err_inter)):
ax.errorbar(i-10,err_mean[i] , yerr=err_long[i],
fmt='.', markersize=10, capsize=15, color='black')
xticks = [-9,-8, -7, -6, -5, -4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11]
xticklabes =['-9','-8','-7','-6','-5','-4','-3','-2','-1','0','1','2','3','4','5','6','7','8','9','10','11']
plt.xticks(xticks,xticklabes,size=50)
yticks = [-2,-1,0,1,2,3,4,5]
yticklabes =['-2','-1','0','1','2','3','4','5']
ax.plot([-9.5,11.5],[0,0], color='black',linestyle = '--',linewidth=2, markersize=12)
plt.xticks(xticks,xticklabes,size=50)
ax.set_ylim(-2.5, 5.5)
ax.set_xlim(-9.5, 11.5)
#ax.fill_betweenx([1, 0], facecolor='lightgrey', alpha=0.3)
#ax.legend(loc='best', fontsize=11, framealpha=1, frameon=True)
#ax.set_xticklabels()
#ax.set_ticklabels()
#ax.set_yticklabels(labels=labels)
ax.set_xlabel('time', fontsize=50)
ax.set_ylabel('coefficient', fontsize=50)
#ax.yaxis.set_major_formatter(plt.NullFormatter())
#fig.tight_layout();
#plt.show()
#plt.savefig(r'C:\Users\sc35131\Desktop\wangyao\Cell_consistence_alogrithm\picture9\\'+'1234',bbox_inches = 'tight',pad_inches = 0,dpi =350)
plt.savefig('平行趋势检验.png')
边栏推荐
- Go语言循环语句(第10课中3)
- Shutter textfield example
- Billions of citizens' information has been leaked! Is there any "rescue" for data security on the public cloud?
- Methods of improving machine vision system
- IIC (STM32)
- [early knowledge of activities] list of recent activities of livevideostack
- 案例分享|金融业数据运营运维一体化建设
- Kubedm initialization error: [error cri]: container runtime is not running
- redis03——Redis的网络配置与心跳机制
- OMS系统实战的三两事
猜你喜欢

MP3是如何诞生的?
![[wechat applet] collaborative work and release](/img/14/2658cf0ba6be9432c74b2490e53d05.png)
[wechat applet] collaborative work and release

创客思维在高等教育中的启迪作用

Cloudcompare & open3d DBSCAN clustering (non plug-in)

应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设

ArcGIS 10.2.2 | solution to the failure of ArcGIS license server to start

Maya lamp modeling
![[public class preview]: basis and practice of video quality evaluation](/img/fd/42b98a08b5a0fd89c119f1d1a8fe1b.png)
[public class preview]: basis and practice of video quality evaluation

TCP shakes hands three times and waves four times. Do you really understand?

Billions of citizens' information has been leaked! Is there any "rescue" for data security on the public cloud?
随机推荐
LambdaQueryWrapper用法
Jerry's ad series MIDI function description [chapter]
MongoDB聚合操作总结
Shutter WebView example
超详细教程,一文入门Istio架构原理及实战应用
redis布隆过滤器
numpy vstack 和 column_stack
Exclusive interview of open source summer | new committer Xie Qijun of Apache iotdb community
挖财学院股票开户安全吗?开户只能在挖财开户嘛?
Open3d surface normal vector calculation
Cloudcompare & open3d DBSCAN clustering (non plug-in)
AcWing 2022 每日一题
MYSQL 用!=查询不出等于null的数据,解决办法
redis03——Redis的网络配置与心跳机制
文件读取写入
Drop down selection of Ehlib database records
PostgreSQL基本结构——表
股票开户流程是什么?使用同花顺手机炒股软件安全吗?
一文掌握数仓中auto analyze的使用
Master the use of auto analyze in data warehouse