Code covered by the BSD License  

Highlights from
xtickinterval, ytickinterval


4.0 | 2 ratings Rate this file 19 Downloads (last 30 days) File Size: 5.76 KB File ID: #30674

xtickinterval, ytickinterval



XTICKINTERVAL forces tick spacing to a specified interval regardless of axis limits.

| Watch this File

File Information

XTICKINTERVAL and YTICKINTERVAL set the tick spacing of the selected axis to a specified interval. If the axis limits change, either at the user's direction or due to the addition or deletion of plot objects, the ticks are automatically recalculated to fill the new limits, maintaining the specified interval.

By default, the ticks will be placed at integer multiples of the chosen interval. If an optional anchor point is given, the ticks will pass through that anchor point while maintaining the desired interval.

Both the interval and anchor point can be changed by calling XTICKINTERVAL with new values. Additionally, calling XTICKINTERVAL('off') will remove the listener function and restore the axis' tick and ticklabel properties to their original state.

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
19 Jun 2013 Eowyn Baughman

Works, but with plotyy when you ask it to adjust the interval on AX(1), it also places ticks on AX(2). You can still set AX(2) but you'll have ticks from AX(1) as well.

09 Oct 2011 Brian B

This is awesome, thank you so much! One recommendation: It would also be nice to specify the number of yticklabels desired based on the current ylim values vs. just an interval.

Contact us