简体   繁体   English

如何在 Matplotlib 中绘制没有线和点的误差条图?

[英]How can I draw an errorbar graph without lines and points in Matplotlib?

I am currently using the following code to plot errorbar graphs.我目前正在使用以下代码绘制误差条图。

plt.errorbar(log_I_mean_, log_V2_mean_, xerr, yerr, '.')

However, the end result shows a circular point in the center of each errorbar intersection point.但是,最终结果会在每个误差条交点的中心显示一个圆形点。 How can I plot just the errorbars without the central point, as is required in scientific work?如何按照科学工作的要求,只绘制没有中心点的误差线?

use 'none' instead of '.'使用'none'而不是'.' :

import matplotlib.pyplot as plt

x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)

yerr = 0.1 + 0.2*np.sqrt(x)
xerr = 0.1 + yerr

plt.figure()
plt.errorbar(x, y, 0.2, 0.4,'none')
plt.title("Simplest errorbars, 0.2 in x, 0.4 in y")

result:结果:

在此处输入图片说明

PS this is slightly modified version of part of the example of pylab here PS这是pylab的部分示例的稍微修改版本here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM