View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

5.0 | 21 ratings Rate this file 29 Downloads (last 30 days) File Size: 2.04 KB File ID: #9715 Version: 1.0
image thumbnail



Frederic Moisy (view profile)


21 Jan 2006 (Updated )

Error bar plot for X-axis in log scale

| Watch this File

File Information

ERRORBARLOGX Homogenize the error bars for X-axis in log scale.

ERRORBARLOGX turns the X-axis of the current error bar plot to log scale, and homogonizes the length of the horizontal segements which terminate the vertical error bars.
By default, Matlab's ERRORBAR draws vertical error bars which are terminated by small horizontal segments of uniform length for the X-axis in linear scale. But when turning the X-axis to log scale, these segments become uneven. Using ERRORBARLOGX makes them uniform again.
    ERRORBARLOGX(N) specifies the relative length of the horizontal segments, normalized with the total range of the data. By default, N=0.01 is used.
    Limitations: ERRORBARLOGX acts only on the last drawn curve. If this curve is not an error bar plot, it won't work.
       y=5*(1 + 0.5*(rand(1,20)-0.5)).*x.^(-2);


This file inspired Eb Ticklength, Errorbarlogy, and Superbar.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (24)
03 Dec 2015 Mario Koddenbrock

04 Apr 2015 Sergei Paleichuk

15 Oct 2012 Emily

Emily (view profile)

19 Sep 2011 David Collins

02 Mar 2011 Miguel Ullan


23 Jul 2010 Audrey

Audrey (view profile)

The image is loglog errorbar, which is I need, but the code is logx error bar, can someone tell how to make the loglog happen?

Comment only
02 Jul 2010 Danmei Bian

Thank you so much!

29 Sep 2008 Leonardo Sepulveda

Excellent. Easy to use.

19 May 2008 Vincent G.

Great, it saved my day!
Thanks a lot!

16 Apr 2008 Martin Hansen

I love it when someone has made just what I'm looking for! This is what the Matlab File Exchange is all about. Thanks!

02 Jan 2008 Mark Runacres

Works great. Thanks!

02 Nov 2007 Ipek Oruc


07 Sep 2007 Philip Du Toit

Works great! Just what I needed.
Works with multiple curves in a single plot.

27 Jul 2007 Alexei Tcherniak

Perfect! Very glad I was able to find such a thing. Makes you wonder why matlab doesn't have it by default

19 Jul 2007 Uli Stark

thanks a lot - helped so much!

11 Mar 2007 Chethan Pandarinath

perfect! thank you very much for this.

29 Jan 2007 matthieu simon

Exactly what I need ! Thanks

10 Oct 2006 Aiko Voigt

21 Sep 2006 Bert Sels

Worked as described. Thanks!

14 Mar 2006 lijun gou

Commands loglog + hold on + errorbar could do the same action.

Comment only
14 Mar 2006 Uwe K├Ątzel

Very useful, works pretty fine

06 Mar 2006 Vincent Pelletier

I Google-searched for a solution to my problem, found your .m file first, and it works like a charm! Thanks!

27 Feb 2006 Andi Petculescu

When I'm trying to run the example provided, the error bar "cap" length is *not* rescaled. I get the following error message:
"??? Index exceeds matrix dimensions.
On line 40 ==> heb = cd.Children(2); % handle to current error bars"

Any input is welcome!

(Matlab 6.5 R13)

Comment only
09 Feb 2006 Nick D

Amazingly useful, and I'm suprised that there isn't something like this built in (as far as I ahve seen)

Contact us