plot multi time series close in value

1 Ansicht (letzte 30 Tage)
Nancy Hammond
Nancy Hammond am 14 Feb. 2023
Kommentiert: Nancy Hammond am 16 Feb. 2023
I am plotting overnight money market rates very close in value so they often end up on top of each other
hE = plot(sdate(begn(k):endn(k)),drates(begn(k):endn(k),1)*100) %,'LineStyle', 'none');
hold on
hO = plot(sdate(begn(k):endn(k)),drates(begn(k):endn(k),2)*100);
hold on
...
I set characteristics
set(hE,'LineStyle', 'none', 'Marker', 'o','MarkerSize', 2,'MarkerEdgeColor','none','MarkerFaceColor',[0 0 1]); % blue
set(hO,'LineStyle', 'none','Marker', 'o','MarkerSize', 2,'MarkerEdgeColor','none','MarkerFaceColor',[ 0 1 0] ); % green
I set Font and Axes Properties
set(gca, ...
'Box' , 'off' , ...
'TickDir' , 'out' , ...
'TickLength' , [.02 .02] , ...
'XMinorTick' , 'on' , ...
'YMinorTick' , 'on' , ...
'YGrid' , 'on' , ...
'XColor' , [.3 .3 .3], ...
'YColor' , [.3 .3 .3], ...
'YTick' , 0:5:350, ...
'LineWidth' , 1 );
set(gca, 'YTick', 0:5:350) % Break 1
set(gca,'YGrid', 'on', 'YTick', 50:5:350) % Break 3
QUESTION:
Can any of the font and axes properties change the spacing between two different time series so that they do not end up on top of each other

Antworten (1)

VBBV
VBBV am 14 Feb. 2023
subplot(211)
hE = plot(sdate(begn(k):endn(k)),drates(begn(k):endn(k),1)*100) %,'LineStyle', 'none');
subplot(212)
hO = plot(sdate(begn(k):endn(k)),drates(begn(k):endn(k),2)*100);
you can use subplot
  2 Kommentare
VBBV
VBBV am 14 Feb. 2023
Bearbeitet: VBBV am 14 Feb. 2023
if you use subplot the overlapping of graphs can be prevented and you'be able to make fairly good comparison of graphs. Since, the values of timeseries are close enough, instead of changing the font and axes properties, its easiler to visaualize them using two seperate graphs aligned equally
Nancy Hammond
Nancy Hammond am 16 Feb. 2023
Thank you. I stil am looking for solution bc I want to plot rates betn their 25 and 75 percentiles to show dispersion and the Fed funds rate between the FOMC target rates. For now I did this in 2 subplots, one target rates, the other w percentiles

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by