Rotate X-axis tick labels
by Ben Tordoff
01 Jun 2010
(Updated 28 Mar 2013)
Rotate x-tick labels to any angle, preserving font settings and coping with resize, zoom, pan etc
|
Watch this File
|
| File Information |
| Description |
This function rotates the x-tick labels on a plot. An arbitrary angle can be specified for the text and the label justification adjusts appropriately to ensure the labels lie below the ticks. The axes font properties are preserved in the labels, which will update in response to font changes. Changes to the axes limits are also handled.
Main features:
* Arbitrary angle of rotation
* Justification adjusts appropriately for the specified angle
* Axes font property changes are reflected
* Labels move correctly when zooming and panning
As with other functions that achieve the same result, this works by replacing the xtick labels with text objects. Handles to the created text objects are returned for you to tinker with. |
| Acknowledgements |
Rotate X Tick Labels For Multi Axes
inspired this file.
This file inspired
Shaded Correlation Table.
|
| MATLAB release |
MATLAB 7.10 (R2010a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 30 Sep 2010 |
Switch to using normalized units for labels to prevent loss of accuracy with hundreds/thousands of labels. |
| 07 Feb 2011 |
Should now honour the "XAxisLocation" property of the axes. |
| 21 Feb 2012 |
Switch to using data coordinates internally to allow printing to work. Please keep the old version in case this breaks something else! |
| 28 Mar 2013 |
Improve behavior when "cla" is called on the axes. |
|
Contact us