作业帮 > 综合 > 作业

matlab 请问如何可以把我在x轴上的标记垂直显示,比如VerticalAlignment

来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/05/01 07:14:29
matlab 请问如何可以把我在x轴上的标记垂直显示,比如VerticalAlignment
%input x and y,where x stands for the sieve size[mm]
%y stands for percent passing[%]
x=[50.8
37.5
25.0
19.0
12.5
9.5
4.75];
y=[100.0
95.6
76.4
62.0
45.8
13.7
1.6];
%plot Semilog aggregate gragation chart
semilogx(x,y,'k-diamond','Color',[0,0,1]);
grid on;
box on;
%add title and label
title('Precent passing vs.sieve size on semilog gradation','FontSize',14);
xlabel('sieve size,mm');
ylabel('Precent Passing,%');
%label each marker
set(gca,'XTick',[4.75,9.5,12.5,19.0,25.0,37.5,50.8]);
set(gca,'XTickLabel',{'4.75','9.5','12.5','19.0','25','37.5','50.8'});
我是指x轴的数字,4.75 9.5 12.5 变成垂直的
matlab 请问如何可以把我在x轴上的标记垂直显示,比如VerticalAlignment
%label each marker
set(gca,'XTick',[4.75,9.5,12.5,19.0,25.0,37.5,50.8]);
set(gca,'XTickLabel',{ });
pos=[4.75,9.5,12.5,19.0,25.0,37.5,50.8];
h=text(pos,pos.*0-10,{'4.75','9.5','12.5','19.0','25','37.5','50.8'})
set(h,'Rotation',90)