XTICKLABEL_ROTATE90

版本 1.0.0.0 (2.0 KB) 作者: Denis Gilbert
Rotate numeric Xtick labels by 90 degrees.
9.9K 次下载
更新时间 2003/3/25

查看许可证

When the XTick labels are long numbers that overlap, making them hard to read or distinguish from one another, you may need to use XTICKLABEL_ROTATE90 in order to orient the tick labels vertically rather than horizontally.

Example 1: Set the positions of the XTicks and rotate them.

figure;
plot([1960:2004],randn(45,1));
xlim([1960 2004]);
xticklabel_rotate90([1960:2:2004]);
%Set "Property-value" pairs
xticklabel_rotate90([1960:2:2004],'Color','m');

Example 2: Rotate XTickLabels at their current position

XTick = get(gca,'XTick');
xticklabel_rotate90(XTick);

引用格式

Denis Gilbert (2024). XTICKLABEL_ROTATE90 (https://www.mathworks.com/matlabcentral/fileexchange/3150-xticklabel_rotate90), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

1) Fontsize is now set equal to the default axes fontsize.

2) Vectorization of text command

3) Now allows for the specification of text property-value pairs, as suggested by Urs Schwarz.