matlab怎么标注竖的文字
我如下这样做:set(gca,'XTick',[1:12]);set(gca,'XTickLabel',{'14:30-14:35','14:35-14:40','14:...
我如下这样做:
set(gca,'XTick',[1:12]);
set(gca,'XTickLabel',{'14:30-14:35','14:35-14:40','14:40-14:45'...
'14:45-14:50','14:50-14:55','14:55-15:00','15:00-15:05','15:05-15:10'...
'15:10-15:15','15:15-15:20','15:20-15:25','15:25-15:30'});
是能标上去,但很密看不清楚。
在matlab中怎么实现如下图那样标X轴啊:
急求,谢谢 展开
set(gca,'XTick',[1:12]);
set(gca,'XTickLabel',{'14:30-14:35','14:35-14:40','14:40-14:45'...
'14:45-14:50','14:50-14:55','14:55-15:00','15:00-15:05','15:05-15:10'...
'15:10-15:15','15:15-15:20','15:20-15:25','15:25-15:30'});
是能标上去,但很密看不清楚。
在matlab中怎么实现如下图那样标X轴啊:
急求,谢谢 展开
展开全部
x = 1:12;
y = ceil(10*rand(1,length(x)));
plot(x,y);
set(gca,'XTick',1:12,'XTickLabel','')
time=['14:30-14:35';'14:35-14:40';'14:40-14:45';...
'14:45-14:50';'14:50-14:55';'14:55-15:00';'15:00-15:05';'15:05-15:10';...
'15:10-15:15';'15:15-15:20';'15:20-15:25';'15:25-15:30'];
hx = get(gca,'XLabel');
set(hx,'Units','data');
pos = get(hx,'Position');
y = pos(2);
for i = 1:size(time,1)
t(i) = text(x(i),y,time(i,:));
end
set(t,'Rotation',90,'HorizontalAlignment','right','FontSize',8)
y = ceil(10*rand(1,length(x)));
plot(x,y);
set(gca,'XTick',1:12,'XTickLabel','')
time=['14:30-14:35';'14:35-14:40';'14:40-14:45';...
'14:45-14:50';'14:50-14:55';'14:55-15:00';'15:00-15:05';'15:05-15:10';...
'15:10-15:15';'15:15-15:20';'15:20-15:25';'15:25-15:30'];
hx = get(gca,'XLabel');
set(hx,'Units','data');
pos = get(hx,'Position');
y = pos(2);
for i = 1:size(time,1)
t(i) = text(x(i),y,time(i,:));
end
set(t,'Rotation',90,'HorizontalAlignment','right','FontSize',8)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询