Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
errorbars, whiskers length, simple question

Subject: errorbars, whiskers length, simple question

From: leo nidas

Date: 7 Feb, 2013 00:10:07

Message: 1 of 1


Hi there,

I want to plot some error bars. The code is at the end of this message and runs just fine. I am plotting five errorbars regarding some estimated quantities "ests" and their corresponding confidence intervals that appear in "cis".

The only thing that I do not like is the length of the horizontal whiskers. Why does it differ form errorbar to errorbar? It actually increases if you observe carefully. I would like all errorbars have the same length regarding their horizontal whiskers.

Thanx in advance for any answers!

close all

cis=[0.5563 0.6911;0.5511 0.6946;0.5578 0.7028;0.5667 0.7067;0.5685 0.7132];
ests=[0.5919;0.5942;0.5962;0.5994;0.6049];
hold on
plot(2.5, ests(1),'*k')
plot(5, ests(2),'*k')
plot(7.5, ests(3),'*k')
plot(10, ests(4),'*k')
plot(12.5,ests(5),'*k')
 

axis([0 14 0 1])
 errorbar(2.5 ,ests(1) ,(ests(1)-cis(1,1)),(cis(1,2)-ests(1)),'k')
 errorbar( 5 ,ests(2) ,(ests(2)-cis(2,1)),(cis(2,2)-ests(2)),'k')
 errorbar(7.5 ,ests(3) ,(ests(3)-cis(3,1)),(cis(3,2)-ests(3)),'k')
 errorbar(10 ,ests(4) ,(ests(4)-cis(4,1)),(cis(4,2)-ests(4)),'k')
 errorbar(12.5,ests(5) ,(ests(5)-cis(5,1)),(cis(5,2)-ests(5)),'k')

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us