Why does the PLOT function in the Financial Time Series Toolbox automatically create two subplots?

1 view (last 30 days)
I have an FTS object named CFcum with 9 dataseries. When I issue the following commands:
figure(5),clf,plot(CFcum(1:63))
MATLAB generates 2 subplots automatically.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 Apr 2023
Edited: MathWorks Support Team on 13 Apr 2023
The problem that you are experiencing is not a bug in MATLAB. The PLOT command in the Financial Toolbox automatically checks if the time series data differ greatly in their decimal scales and creates subplots with different axes for them.
The PLOT function uses a threshold for determining whether to use separate axes if the exponents differ by a factor of 10^4. 
If you do not want to see the subplots, you can work around this problem by manually specifying the axis and plot the data separately by changing your code and separating the dataseries that has a different range from the others:
fn1 = {'bin7d_1m' 'bin1m_3m' 'bin3m_1y' 'bin1y_2y' 'bin2y_3y' ,...
'bin3y_5y' 'bin5y_10y' 'bin_10y'};
%fn1 is an FTS object of dataseries with the same range
fn2 = {'bin0_7d'};
%fn2 is the FTS object of dataseries with ranges than those in fn1
fts2 = fints(dates,data(:,[1]),fn2)
fts = fints(dates,data(:,[2 3 4 5 6 7 8 9]),fn1)
figure(1),plot(fts2)
hold on;
plot(fts)
xmin = datenum('29-Nov-2004')% assume dataseries starts at 29-Nov-2004
xmax = datenum('04-Dec-2004')% assume dataseries ends at 04-Dec-2004
axis([xmin xmax 0 6.0000e+009])

More Answers (0)

Community Treasure Hunt

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

Start Hunting!