Plot time series object in logarithmic scale

4 ビュー (過去 30 日間)
Hampus
Hampus 2017 年 1 月 20 日
コメント済み: Hampus 2017 年 1 月 20 日
I have two nx2 vectors:
date = date number
closep = closing price
I then want to plot the time series with logarithmic scale. Anyone who knows how to do this?
So far I've only:
tsobj = fints(date, closep)
plot(tsobj)

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 1 月 20 日
set(gca, 'YScale', 'log')
  3 件のコメント
Walter Roberson
Walter Roberson 2017 年 1 月 20 日
? With that tsobj and that plot() command, closep will be the Y axis, and the set() to log scale will change the axis scaling and the default y tick locations and default y tick label formatting
For example,
tsobj = fints([(now-(500:-1:401)/10).'], rand(100,2));
plot(tsobj)
set(gca, 'YScale', 'log')
the Y ticks will get labeled with powers of 10 in this example.
If you are looking for a different tick label format or tick positions, then the way to do that is going to depend upon what your MATLAB release. In particular are you using R2014b or later?
Hampus
Hampus 2017 年 1 月 20 日
later, thanks mate

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by