I've been trying to use this function to replace the ticks with letter strings (e.g., 'frontal', 'temporal', etc.) that are stored in cell array. I get an error message saying that the function does not accept cell as input. How can I solve the problem?
I like this function's potential, but I'm not presently able to use it well. I'm working with x-axis limits that are multiples of pi, and I'd like to label the axis as such. It is unclear how to do this. Your example simply appends a pi. I'd like to specify the XTicks at pi-based intervals (possibly fractional), then use tick2text to place labels with pi in the tick marks.
For example, consider a uniform probability density function for a radian angle. It is distributed (x-axis) between [-pi,pi] and has a value of 1/(2*pi). I'd like to tick the x-axis at, say, pi/4 intervals, and the y-axis at 1/pi, 1/[2*pi], 1/[4*pi], etc. etc.
04 Sep 2007
When using this function, the tick labels overlap axis labels, so this function is only useful if xlabel or ylabel is not required
23 Aug 2007
Sorry, forgot to rate it.
23 Aug 2007
If the tick-label position is computed relative to xlabel, ylabel and zlabel, this function can be extended to 3-D figures as well.
02 Mar 2009
Added function handle input option, corrected some bugs, and added new example
04 Jun 2009
Fixed erroneous behavior when axes are logarithmically scaled
30 Jun 2009
Added ability to modify x,y, and z ticks for 3D axes
27 Mar 2013
- no longer need to manually specify axis offsets
- added simple reformat without conversion-to-text option
- more robust handing of non-default configured axes ([XYZ]Dir, [XYZ]Scale, and [XY]AxisLocation properties changed)