Questions about "dseries" plot method behaviour

There was a previous example by Stéphane Adjemian (see Placing dates on the horizontal axis of historical shock decomposition shocks - #4 by stepan-a) showing its very easy implementation.

However, for me the above example does not work in Dyanre 6. The answer can be found in the examples in

If you have created two dseries objects named, say, ts1 and ts2 (with the latter being in a subsample of the former)

plot(ts1(ts2.dates).data,‘-k’); % Plot of the stationary component.
hold on
plot(ts2.data,‘–r’); % Plot of the filtered y.
hold off
axis tight
id = get(gca,‘XTick’);
set(gca,‘XTickLabel’,strings(ts1.dates(id)));

The key for the dates being plotted lies in the last two lines.