横坐标标签如何变斜体?

x = 1:12;
y = 10*rand(1,length(x));
h = plot(x,y,'+');

% Remove the default labels
set(gca,'XTickLabel','')

% 设定X轴刻度的位置,以使其与标定的月份对应
Xt = 1:1:12;
Xl = [1 12];
set(gca,'XTick',Xt,'XLim',Xl);

% 加入文本标签
months = {'Jan';'Feb';'Mar';'Apr';'May';'Jun';'Jul';'Aug';'Sep';'Oct';'Nov';'Dec'};
Yl = ylim;
t = text(Xt,Yl(1)*ones(1,length(Xt)),months(1:1:12));
set(t,'HorizontalAlignment','right','VerticalAlignment','top', 'Rotation',45);

你可能感兴趣的:(plot)