当我尝试编译附加的代码时,我收到以下错误消息。我尝试了所有方法,但找不到错误。
Runaway argument?
\pgfplots@calender@ZEROSHIFT \relax \ifx \pgfplotstemptime \pgfutil@empty \ETC.
! File ended while scanning use of \pgfcalendar@datetojulian.
<inserted text>
\par
这是一个示例文档。
\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}
答案1
使用破折号代替斜线可以避免编译错误。
\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}