更改误差条大小 [英] Change errorbar size

查看:50
本文介绍了更改误差条大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须更改情节中标记的大小(使其变大).如何也可以更改误差条的宽度?我正在使用 matplotlib .谢谢.

I have to change the size of the markers in my plot (making them bigger). How is it possible to change the width of errorbars too? I'm using matplotlib. Thanks.

plot=ax.errorbar(x,y, yerr=[y1,y2], color='red', fmt='.', markersize='10', ecolor='red',capsize=4)

推荐答案

您可以通过在调用 errorbar(x,y,...) 时设置 elinewidth 属性来使错误栏变粗错误栏文档.但是误差条的长度是你的数据:你不能改变长度而不改变它所代表的错误.

You can make the error bar thicker by setting the elinewidth attribute in the call to errorbar(x,y,...) errorbar documentation. But the length of the error bar is your data: you can't change the length without changing the error that it represents.

import matplotlib.pyplot as plt

# define x,y, y1,y2 here ...

plt.figure()
plt.errorbar(x,y, yerr=[y1,y2], color='red', fmt='.', markersize='10', ecolor='red',capsize=4, elinewidth=2)

这篇关于更改误差条大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆