I have some data as a function of time. I plot it using dateplot from the pgfplots package. I would like to have x labels in hours and minutes. For every day, I would like to have an additional DD.MM.YYYY label. This entry should only appear once per day, so the tick labels don't get too cluttered. (see below for MWE with picture)
Question 1: Is there any way to automatically get an x tick label every three hours? Right now, I have to give a full list with all x tick labels.
Question 2: Can I somehow automate the additional date label?
\documentclass{article}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\begin{tikzpicture}
\begin{axis}[compat=1.5.1,
date coordinates in=x,
xticklabel={\hour:\minute},
xticklabel style= {rotate=45,anchor=north east},
xtick={
{2010-06-22 9:00},
{2010-06-22 12:00},
{2010-06-22 15:00},
{2010-06-22 18:00},
{2010-06-22 21:00},
{2010-06-23 00:00},
{2010-06-23 03:00},
{2010-06-23 06:00},
{2010-06-23 09:00}
},
date ZERO=2010-06-22,
xlabel=Date and time,
xlabel shift=20pt,
ylabel=Random stuff,
xmin={2010-06-22 9:00},
xmax ={2010-06-23 07:25},
minor x tick num = 2,
clip=false
]
\addplot coordinates {
(2010-06-22 09:06:03,0.1)
(2010-06-22 16:14:07,0.8)
(2010-06-23 07:00:25,1)
};
\node[anchor=north] at (xticklabel cs:0.1) {22.06.2010};
\node[anchor=north] at (xticklabel cs:0.75) {22.06.2010};
\end{axis}
\end{tikzpicture}
\end{document}
