tags:

views:

180

answers:

3

Hi,

I would like to define error bars on both ends for matlab. Usually, the example of matlab would be http://matlab.izmiran.ru/help/techdoc/ref/errorbar.html where the error bar would take the standard deviation (E) and make it equal(symmetric) on both ends.

I would like to define two points specifically apart from plotting the exact point (x,y).

Please advise. Thanks.

A: 

Do you want to use L and U parameters for specify low and upper error distance?

Singlet
A: 

As Singlet mentions, the L and U parameters for errorbar should do the job:

% Create some example input data.
x = 1:10
y = cumsum( randn(1,10) );
lower = y - ( rand(1,10) );
upper = y + ( rand(1,10) );

% Convert absolute lower and upper bounds into the relative values 
% values that are expected by the errorbar function.
L = y - lower;
U = upper - y;

figure(1);
clf;
hold('on');
plot( x, y, 'b-' );
errorbar( x, y, L, U, 'r', 'Marker', 'none', 'LineStyle', 'none' );
William Payne
A: 

Hi,

Thanks for the reply. I figured out the L and U from the formula you mentioned, William.

However, the next problem I have is trying to define all these error bars to fit into a graph. I might have 14 points instead of 10. I wanted to plot errorbar this time with the bar.

I referred on BARWEB package but it does not allow me to define each error bar appropriately. Typically I have 14 bars with different labelling such as 'Apple', 'Orange', 'Strawberry'.....

Any suggestion?

ash
You should edit your question to add this extra information, not add it as a new answer (which it isn't). Then you can delete this answer when you're done updating the question.
gnovice

related questions