如何使用错误栏绘制非对称错误 [英] How to plot asymnmetric errors with errorbar

查看:104
本文介绍了如何使用错误栏绘制非对称错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个类似于15/16页的图:

I would like to create a plot like pages 15/16:

comisef.eu/files/wps031.pdf

comisef.eu/files/wps031.pdf

下面的示例已结束,但仅允许对称误差线:

The example below gets close but only allows for symmetric error bars:

http ://www.mathworks.com/matlabcentral/fileexchange/35294-matlab-plot-gallery-errorbar-plot/content/html/Errorbar_Plot.html

此示例具有不对称误差条,但仅当针对条形图值进行绘制时 在Matlab中具有不对称误差范围的栏

This example has asymmetric errorbars but only when plotted against the bar graph values bar with asymmetric error bounds in Matlab

是否可以像所示的第一个示例那样具有不对称的误差线,而无需条形图?

Is it possible to have asymmetric errorbars like in the first example shown but without the need for the bar graph?

感谢巴兹

我也有一个问题,我在哪里尝试通过boxplot实现相同的目的,但是我不确定哪个(如果确实可以做到)可以做到.

I also have a question where I try to achieve the same thing with boxplot but I'm not sure which (if indeed either of them can) can do it.

Matlab箱线图

x = 1985:.05:2001; % x data
grad_ = rand(1,length(x))*.3; % graduated stuff
grad_2 = rand(1,length(x))*.3;
grad_3= rand(1,length(x))*.3;
h = subplot(1,3,1);

errorbar(grad_,x,grad_2,grad_3,'o');
axis(h, [0 0.6 1985 2001])
set(h, 'Ytick', x(1):x(end), 'Xtick', 0:.15:.6, 'YDir','reverse', 'YGrid', 'on');
xlabel('Gradient Search')

推荐答案

matlab函数

The matlab function errorbar can create an asymmetric error bar and does not require a bar graph.

close all
x = 1:3;
y = [4 6 3];
lower = [1 4.5 0];
upper = [4.2 2 4];

errorbar(x, y, lower, upper, 'o')

这篇关于如何使用错误栏绘制非对称错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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