Plot a time series with the whole number not 10^(n)

Hi
I would like to plot one time series which is able to show the whole number in y axis not 10^(n)
The following is my code.
y = yahoo;
Dataset = fetch(y, '^HSI','Close','2012-01-01','2012-02-01');
hsiobj = fints (Dataset(:,1),Dataset(:,2));
plot(hsiobj); legend('HSI');xlabel('Date'); ylabel('HSI');
I want to y axis showing 21000 instead of 2.1*10^4 etc.
Thanks so much Jessica

 채택된 답변

Patrick Kalita
Patrick Kalita 2012년 2월 7일

1 개 추천

This page describes how to apply any kind of numeric fomatting to your axes tick labels.

추가 답변 (2개)

Kevin Holst
Kevin Holst 2012년 2월 7일

1 개 추천

Yeah I deleted my answer after I realized that num2str doesn't work properly, but found that num2cell does. Glad it worked for ya! :)

댓글 수: 2

Jessica
Jessica 2012년 2월 7일
I want to accept your answer too . But mathwork just allows me to accept one....
Anyway thanks so much!
Great help=)
haha no worries ;)

댓글을 달려면 로그인하십시오.

Jessica
Jessica 2012년 2월 7일

0 개 추천

Using num2cell instead of num2str.
My answer is the following
y = yahoo;
Dataset = fetch(y, '^HSI','Close','2012-01-01','2012-02-01');
hsiobj = fints (Dataset(:,1),Dataset(:,2));
plot(hsiobj); legend('HSI');xlabel('Date'); ylabel('HSI');
set(gca, 'YTickLabel', num2cell(get(gca, 'YTick')))
Many Thanks=)

카테고리

도움말 센터File Exchange에서 Red에 대해 자세히 알아보기

태그

질문:

2012년 2월 7일

편집:

2013년 10월 3일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by