|
Anish Goorah wrote:
> I have a year vector which runs from [19974:20064] and i
> plot it with another return vector with the following command:
>
> plot(year,return)
>
> It works fine except that when it is displaying the plot it
> shows the numbers in standard form on teh x-axis, i.e. it
> shows 1.97*10^4, 1.98*10^4 etc. How do i just switch it back
> to 19974 as to mean Q4 in 1997? It's the first time I have
> had this issue in matlab....
See the XTickLabel property of an axis. E.g.
x = 1:16;
l = repmat(1997:2000,4,1);
l = num2str(l(:));
l2 = repmat(['Q1';'Q2';'Q3';'Q4'],4,1);
ll = [l,l2];
y = sin(x);
plot(x,y,'.')
set(gca,'XTickLabel',ll)
set(gca,'XTick',x)
|