With pgfplot using dateplot when plotting data over a small date range, some dates are shown multiple times to "fill" the horizontal axis. I wonder if it is possible to show only discrete dates. Since I automate the generation of figures I don't want to set the ticks manually.
Here my working example:
\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\pgfplotsset{compat=1.12}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
date,value
2015-01-01, 3.2
2015-01-02, 6.5
2015-01-04, 6.8
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\centering
\begin{axis}[
date coordinates in=x,
xticklabel={\day-\month-\year},
x tick label style={rotate=45,anchor=north east},
date ZERO=2015-01-01,
grid=both,
enlarge x limits=false,
xlabel={Date (day-month-year)},
ylabel={Value},
]
\addplot table [x=date, y=value, col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}
\end{document}


xtick=databe an option? – Torbjørn T. Jan 08 '16 at 08:25dateplot, the problem also occurs for plotting with integers instead of dates. Should I change this question or ask a new one? – Joost Döbken Jan 08 '16 at 08:32