Code covered by the BSD License  

Highlights from
Update error bar widths automatically on figure resize

5.0

5.0 | 2 ratings Rate this file 8 Downloads (last 30 days) File Size: 19.25 KB File ID: #33734
image thumbnail

Update error bar widths automatically on figure resize

by Chris Rodgers

 

11 Nov 2011 (Updated 11 Nov 2011)

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

| Watch this File

File Information
Description

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.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Adjust error bar width

MATLAB release MATLAB 7.13 (2011b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
21 Nov 2011 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:

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

09 Jan 2012 AMD  
09 Jan 2012 AMD

Very helpful! Thanks!

Please login to add a comment or rating.
Updates
11 Nov 2011

Include errorbar_tick.m in the zip file for convenience.

Tag Activity for this File
Tag Applied By Date/Time
callback Chris Rodgers 11 Nov 2011 11:04:26
figure Chris Rodgers 11 Nov 2011 11:04:26
errorbar Chris Rodgers 11 Nov 2011 11:04:26
error Chris Rodgers 11 Nov 2011 11:04:26
bar Chris Rodgers 11 Nov 2011 11:04:26

Contact us at files@mathworks.com