Here's the code I want to compile:
\documentclass{article}
\usepackage{tikz, pgfplots}
\usepgfplotslibrary{dateplot}
% from https://tex.stackexchange.com/a/288225/231104
\def\pgfplotslibdateplothour:minutetofloat#1:#2.{
\pgfmathparse{#1+#2/60}
}
\def\pgfplotslibdateplofloattothour:minute#1.{
\pgfmathsetmacro\hour{int(floor(#1))}
\pgfmathsetmacro\minute{int((#1-\hour)*60)}
\ifnum\hour<10\edef\hour{0\hour}\fi
\ifnum\minute<10\edef\minute{0\minute}\fi
}
\pgfplotsset{
/pgfplots/time coordinates in/.code={%
\pgfkeysdef{/pgfplots/#1 coord trafo}{%
\pgfplotslibdateplothour:minutetofloat##1.
}
\pgfkeysdef{/pgfplots/#1 coord inv trafo}{
\pgfplotslibdateplofloattothour:minute##1.
}
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
time coordinates in=x,
xticklabel={\hour:\minute},
]
\addplot coordinates {
(10:00, 0)
(10:30, 25)
(10:40, 28)
(11:00, 40)
(11:15, 42)
(11:30, 50)
};
\end{axis}
\end{tikzpicture}
\end{document}
But on compiling, it just gives a 'Something went wrong' sign. Seems like the code misses something essential, but I couldn't find what.
Please help, thanks!
