How do I make the time label in the following image appear as "10:00" (i.e. 10 o'clock) rather than the unexpected and unwelcome "09:60"?
Here's the code that I am using:
\documentclass{beamer}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\frame{
\begin{tikzpicture}
\begin{axis}[
mark =none,
xmin=2009-08-18 08:30,
xmax=2009-08-18 10:29,
ymin=0,
ymax=189,
grid=both,
axis x line=bottom,
axis y line=left,
date coordinates in=x,
minor x tick num=5,
minor y tick num=4,
xtick={2009-08-18 09:00,2009-08-18 10:00},
ytick={0,50,100,150},
xticklabel= \hour:\minute,
]
\addplot [thick,blue]coordinates {
(2009-08-18 08:30, 000)
(2009-08-18 09:00, 060)
(2009-08-18 09:20, 060)
(2009-08-18 10:00, 100)
(2009-08-18 10:10, 060)
} node [below] {Train A};
\end{axis}
\end{tikzpicture}
}
\end{document}
Supplementary question:
In the image above, why don't the minor tick lines appear before "09:00" but only after?
Best Answer
This is a known bug that's fixed in the development version of PGFplots. You can include the bugfix without upgrading the package by defining the patched function in your preamble.
I'm not sure what's going on with the grid lines, you may want to file a bug report about that. You can work around it by using the following settings:
Here's the complete code: