How to surpress timegaps within DateListPlot

Hi,
As you can see below the code produces a DateListPlot for some Trading data. In the weekends there no trading and DateListPlot shows this in the plot by skipping these values and connecting the friday and mondays. This of course creates a “gap” between the friday and monday.
How can I get the fridays and monday values next to each other? Is there an option to do this?

data = FinancialData[“^AEX”, {{2015, 1, 1}, {2015, 2, 1}}];

DateListPlot[data, Frame → False,
Ticks → {data[[All, 1]], Automatic}, DateTicksFormat → {“Day”},
ImageSize → {600, 100}, AspectRatio → 100/600.]

So the gap below between 09 and 12 I would have liked removed

thx for helping

Hi,

I am not quite sure whether I understand the problem. Because of the “weekend” there is no trading so there should be no points for the missing days. If your problem is about the plot and you do not want the ticks to be placed like that this might help:

DateListPlot[data]

which gives:

If you want to “delete the weekends” from the time series, and you think of the x-axis as trading days you can just plot the values:

data[[All, 2]] // ListLinePlot

A more complete solution might be this:

ListLinePlot[data[[All, 2]], Frame -> True, PlotStyle -> Directive[Red, Thickness[0.01]], 
FrameTicks -> {{All, None}, {Table[{j, Rotate[DateString[DateObject@DatePlus[{2015, 1, 1}, 
{j, "BusinessDay"}]], Pi/2]}, {j, 1, Length[data], 1}], None}}]

I am sure that there is a better way of doing it, but this one gives you quite a bit of control over the figure.

Cheers,

M.

Hi Marcus,
Thx this should work for me. It feels a bit like cheating but I’m fine with that :slight_smile: