Most likely this is trivial for those with some experience in all these expansion issues, but I have a simple question concerning pgfplots. I want to modify its parsing behavior a bit. (Yes, I am aware of the dateplot library, but I did not succeed in adjusting the tricks there to my needs.) This question is motivated by this question. I just want to convert some data, specifically times here, to numbers. This is my attempt.
\documentclass[11pt, twoside, a4paper]{report}
\usepackage{pgfplots}
%\usepgfplotslibrary{dateplot}
\pgfplotsset{compat=1.16}
\usepackage{filecontents}
\begin{filecontents*}{somedata.csv}
Time;AC
00:00:00;-0.4442
00:01:00;-0.4445
\end{filecontents*}
\makeatletter
\def\myparse#1:#2:#3 #4{%
\pgf@xa=#1pt
\pgf@xb=#2pt
\divide\pgf@xb by60
\advance\pgf@xa by\pgf@xb
\pgf@xb=#3pt
\divide\pgf@xb by3600
\advance\pgf@xa by\pgf@xb
\ifdim\pgf@xa<0pt
\pgf@xa=0pt
\fi
\edef#4{\pgf@sys@tonumber\pgf@xa}%
}%
\newcommand\TimeParse[1]{\myparse#1 \tmp%
\tmp
}
\makeatother
\begin{document}
\TimeParse{00:01:00}
\begin{tikzpicture}
\begin{axis}
%\addplot table [x expr=\TimeParse{\thisrow{Time}}, y=AC, col sep=semicolon] {somedata.csv};
\end{axis}
\end{tikzpicture}
\end{document}
Unsurprisingly, the \TimeParse{00:01:00} returns a number. However, once I try to prepend it to the coordinates with x expr=\TimeParse{\thisrow{Time}}, this "parser" fails with an ! Argument of \myparse has an extra }. error, and I am not able to fix that. (It would also be great if an answer of this question could contain a bit of explanation.... This may make it possible to parse more general types of data.;-)
