I tried to plot a data set containing seconds and milliseconds with pgfplots. I’ve found a solution for my task here (pgfplots data time format), which I changed a bit. This principally works very well. My code goes here:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{dateplot}
\def\transformtime#1:#2:#3!{
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}
\pgfmathparse{#1*3600-\pgfkeysvalueof{/pgfplots/timeplot zero}*3600+#2*60+#3}
\pgfkeys{/pgf/fpu=false}
}
\pgfplotsset{
timeplot zero/.initial=0,
timeplot/.style={
y coord trafo/.code={\expandafter\transformtime##1!},
y coord inv trafo/.code={%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed,}
\pgfmathsetmacro\hours{floor(##1/3600)+\pgfkeysvalueof{/pgfplots/timeplot zero}}
\pgfmathsetmacro\minutes{floor((##1-(\hours - \pgfkeysvalueof{/pgfplots/timeplot zero})*3600)/60)}
\pgfmathsetmacro\seconds{##1-floor((##1)/60)*60}
\def\pgfmathresult{\pgfmathprintnumber{\hours}:\pgfmathprintnumber{\minutes}:\pgfmathprintnumber[fixed zerofill]{\seconds}}
\pgfkeys{/pgf/fpu=false}
},
scaled y ticks=false,
yticklabel=\tick
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
timeplot, timeplot zero=0, grid=major, grid style=dashed, ytick={00:12:00, 00:13:00, 00:14:00},
]
\addplot table {
State Time
-13 00:12:42.40
-12 00:12:57.06
-11 00:13:17.59
-10 00:13:40.83
-9 00:14:07.44
-8 00:14:31.11
-7 00:14:04.28
-6 00:14:12.07
-5 00:14:09.27
-4 00:13:59.92
-3 00:13:56.82
-2 00:13:55.17
-1 00:13:53.52
0 00:13:52.47
1 00:13:59.32
2 00:14:00.58
3 00:13:43.12
4 00:13:49.05
5 00:13:28.63
};
\end{axis}
\end{tikzpicture}
\end{document}
The problem now is that I get odd tick labels (both 12:60 and 14:0.00 is not I was expecting...):

I found a similar question (Date plot using pgfplots with odd tick label), but with that solution I unfortunately do not know how to solve my problem. Could anyone here give me a hint?

12:60is obviously wrong, but I'm not sure what you were expecting instead of the14:0.00. Do you want that to print as14:00? – Jake Dec 14 '13 at 16:36