Why does the PLOT function in the Financial Time Series Toolbox automatically create two subplots?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Editada: MathWorks Support Team
el 13 de Abr. de 2023
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.
Respuesta aceptada
MathWorks Support Team
el 13 de Abr. de 2023
Editada: MathWorks Support Team
el 13 de Abr. de 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])
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Axes Appearance en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!