Code covered by the BSD License  

Highlights from
Update error bar widths automatically on figure resize

5.0 | 5 ratings Rate this file 17 Downloads (last 30 days) File Size: 19.3 KB File ID: #33734
image thumbnail

Update error bar widths automatically on figure resize


Chris Rodgers


11 Nov 2011 (Updated )

Add callback to the current axis to maintain a sensible error bar width on zooming.

| Watch this File

File Information

The Matlab errorbar() function produces error bars with a fixed width in axis units. This makes it hard to zoom in on the plot. This code cleans up the behavior on zooming.


Adjust Error Bar Width inspired this file.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
04 Nov 2014 Cengiz Gunay

Cengiz Gunay

Nice trick for resizing.

14 May 2014 Luuk


Works perfectly, thank you!

07 May 2013 Sadegh Bakhtiarzadeh

Sadegh Bakhtiarzadeh

09 Jan 2012 AMD


Very helpful! Thanks!

Comment only
09 Jan 2012 AMD


21 Nov 2011 Jiro Doke

Jiro Doke

Very nice entry!

I have one comment about your implementation. Your use of "handle" is not a fully supported syntax (undocumented), so I just want to make sure that you're aware of that. Using an unsupported syntax may break in future releases, so extra caution is required.

For your code, you might find the customization capability of "zoom" to be useful:

11 Nov 2011

Include errorbar_tick.m in the zip file for convenience.

Contact us