4

I get the following error message when I try to compile the attached code. I tried everything, but can't find the error.

Runaway argument?
\pgfplots@calender@ZEROSHIFT \relax \ifx \pgfplotstemptime \pgfutil@empty \ETC.
! File ended while scanning use of \pgfcalendar@datetojulian.
 <inserted text> 
                \par

Here's an example document.

\documentclass{article}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xticklabel={\hour:\minute:\second},
date coordinates in=x,
xticklabel style= {rotate=45,anchor=north east},
xtick={
    {07/01/2013 04:00:00}
    {07/01/2013 05:00:00}
},
xmin={07/01/2013 04:00:00},
xmax ={07/01/2013 05:00:00},
clip = false,
xlabel=Date and time,
ylabel=physical storage]
\addplot plot coordinates {
    (07/01/2013 04:42:45, 4096.0)
    (07/01/2013 04:45:45, 6144.0)
    (07/01/2013 04:49:45, 8192.0)
    (07/01/2013 04:52:45, 8192.0)
};
\end{axis}
\end{tikzpicture}
\end{document}
  • You have to use - instead of / and there is a missing , between the two xticks. It is also better to add a date ZERO specification in the axis environment like this date ZERO={07/01/2013} – Red Jul 1 '13 at 15:25
4

Using dashes instead of slashes compile without errors.

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xticklabel=\hour:\minute:\second,
date coordinates in=x,
xticklabel style= {rotate=45,anchor=north east},
xtick={
    {07-01-2013 04:00:00},
    {07-01-2013 05:00:00}
},
xmin={07-01-2013 04:00:00},
xmax ={07-01-2013 05:00:00},
clip = false,
xlabel=Date and time,
ylabel=physical storage
]
\addplot coordinates {%
(07-01-2013 04:42:45, 4096.0)
(07-01-2013 04:45:45, 6144.0)
(07-01-2013 04:49:45, 8192.0)
(07-01-2013 04:52:45, 8192.0)
};
\end{axis}
\end{tikzpicture}
\end{document}
  • Thanks! I found out, that the / are ok inside the timestamps as well. The problem was the curling brackets in xticklabel, which you have removed. Thx! – Tobi Jul 1 '13 at 15:28
  • @Tobi Wow did I? That was pure luck. Sorry :) – percusse Jul 1 '13 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.