File Exchange

image thumbnail

Update error bar widths automatically on figure resize

version 1.1.0.0 (19.3 KB) by Chris Rodgers
Add callback to the current axis to maintain a sensible error bar width on zooming.

1 Download

Updated 11 Nov 2011

View License

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.

Cite As

Chris Rodgers (2019). Update error bar widths automatically on figure resize (https://www.mathworks.com/matlabcentral/fileexchange/33734-update-error-bar-widths-automatically-on-figure-resize), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Nice trick for resizing.

Luuk

Works perfectly, thank you!

AMD

Very helpful! Thanks!

AMD

jiro

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:

http://www.mathworks.com/help/techdoc/ref/zoom.html#brux2aq

Updates

1.1.0.0

Include errorbar_tick.m in the zip file for convenience.

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Adjust error bar width

Inspired: superbar