python errorbar_科学网—Python里面给数据点不同颜色不对称的横纵误差棒 - 张书会的博文...

这篇博客展示了如何在Python中使用matplotlib库为数据点添加不同颜色的横纵误差棒。通过示例代码,作者解释了如何绘制散点图、设置误差棒的透明度和大小,并给出了创建直方图的步骤,以便于理解数据分布。
摘要由CSDN通过智能技术生成

eg1:

eg2:

x1=mux1_mcmc[0]

y1=muy1_mcmc[0]

x2=mux2_mcmc[0]

y2=muy2_mcmc[0]

x1err=sigmax1_mcmc[0]

y1err=sigmay1_mcmc[0]

x2err=sigmax2_mcmc[0]

y2err=sigmay2_mcmc[0]

x=samplers[:,0]

y=samplers[:,1]

print(len(x))

print(np.min(x),np.max(x),np.min(y),np.max(y))

left, width = 0.1, 0.65

bottom, height = 0.1, 0.65

spacing = 0.005

rect_scatter = [left, bottom, width, height]

rect_histx = [left, bottom + height + spacing, width, 0.2]

rect_histy = [left + width + spacing, bottom, 0.2, height]

# start with a rectangular Figure

plt.figure(figsize=(8, 8))

ax_scatter = plt.axes(rect_scatter)

ax_scatter.tick_params(direction='

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值