当前位置:网站首页>置信区间的画法
置信区间的画法
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')
边栏推荐
- Analyzing the maker space contained in steam Education
- Analysis of maker education technology in the Internet Era
- Keep on fighting! The city chain technology digital summit was grandly held in Chongqing
- QT—绘制其他问题
- new IntersectionObserver 使用笔记
- A quick start to fastdfs takes you three minutes to upload and download files to the ECS
- 更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
- [optimtool.unconstrained] unconstrained optimization toolbox
- Case sharing | integrated construction of data operation and maintenance in the financial industry
- Cloudcompare & open3d DBSCAN clustering (non plug-in)
猜你喜欢

Can be displayed in CAD but not displayed in print
![[early knowledge of activities] list of recent activities of livevideostack](/img/14/d2cdae45a18a5bba7ee1ffab903af2.jpg)
[early knowledge of activities] list of recent activities of livevideostack

奋斗正当时,城链科技战略峰会广州站圆满召开

Redis 排查大 key 的3种方法,优化必备

【LeetCode】17、电话号码的字母组合

Bookmark

Keep on fighting! The city chain technology digital summit was grandly held in Chongqing

【活动早知道】LiveVideoStack近期活动一览

【C语言】符号的深度理解

Cloudcompare & open3d DBSCAN clustering (non plug-in)
随机推荐
gtest从一无所知到熟练运用(1)gtest安装
Exclusive interview of open source summer | new committer Xie Qijun of Apache iotdb community
Numpy vstack and column_ stack
MongoDB中的索引操作总结
MP3是如何诞生的?
Drop down selection of Ehlib database records
Flutter在 release版本,打开后随机白屏不显示内容
超详细教程,一文入门Istio架构原理及实战应用
Jerry's ad series MIDI function description [chapter]
Shutter textfield example
Go language loop statement (3 in Lesson 10)
Monitor the shuttle return button
Application practice | Shuhai supply chain construction of data center based on Apache Doris
2021 CCPC Harbin B. magical subsequence (thinking question)
minidom 模塊寫入和解析 XML
文件读取写入
股票开户流程是什么?使用同花顺手机炒股软件安全吗?
Lambdaquerywrapper usage
SolidWorks工程图添加材料明细表的操作
[public class preview]: basis and practice of video quality evaluation