轴刻度标签上的符号

时间:2014-02-13 04:15:57

标签: matlab label matlab-figure

在下面的代码中,我想更改x轴,使其显示为0,a0,2a0,3a0 ......而不是非常小的数字。另外,如何才能显示所需的刻度,例如0和3a0?

a0 = 5.59e-11;
X = linspace(0,5*a0,100);
A = 3;
B = a0/2;
Y = gampdf(X,A,B);
plot(X,Y);

1 个答案:

答案 0 :(得分:2)

这是:

a0 = 5.59e-11; 
X = linspace(0,5*a0,100);
A = 3;
B = a0/2;
Y = gampdf(X,A,B);
plot(X,Y);

set(gca,'XTick',[0:a0:a0*5])
set(gca,'XTickLabel',{'0','a0','2a0','3a0','4a0','5a0'})
set(gca,'XTickLabel',{'0','','','3a0','',''})