![未绘制线](https://linux22.com/image/329245/%E6%9C%AA%E7%BB%98%E5%88%B6%E7%BA%BF.png)
最低限度-不起作用-例如:
\documentclass[letterpaper]{article}
\usepackage{pgfplots,tikz}
\usepgfplotslibrary{dateplot}
\usepackage[margin=0.5in]{geometry}
\pgfplotsset{compat=1.11}
\begin{document}
\vspace*{3cm}
\begin{tikzpicture}
\begin{axis}[
xmin=2015-12-21 00:00:00,
xmax=2016-01-22 00:00:00,
hide y axis,
ymin= 0,
ymax = 1,
y = 1cm,
axis x line*=bottom,
date coordinates in=x,
date ZERO=2015-12-21 00:00:00,
width=6.5in,
xlabel style = {yshift=4mm,anchor=east},
x tick label style={
rotate=45,yshift=-0.1cm,
anchor=east,font=\large\bfseries}
]
\addplot [line width=6pt] table[col sep=comma] {
2015-12-21 06:31:00, 0.5
2016-01-13 08:41:00, 0.5
};
\end{axis}
\end{tikzpicture}
\end{document}
答案1
您必须包括header=false
表输入的配置,因为这是最初的true
,请参阅第 50 页最新pgfplots
手册(v1.13)。如果不包含此项,则表格的第一行将用作列名。
因此下面的操作应该可行:
\documentclass[letterpaper]{article}
\usepackage{pgfplots,tikz}
\usepgfplotslibrary{dateplot}
\usepackage[margin=0.5in]{geometry}
\pgfplotsset{compat=1.11}
\begin{document}
\vspace*{3cm}
\begin{tikzpicture}
\begin{axis}[
xmin=2015-12-21 00:00:00,
xmax=2016-01-22 00:00:00,
hide y axis,
ymin= 0,
ymax = 1,
y = 1cm,
axis x line*=bottom,
date coordinates in=x,
date ZERO=2015-12-21 00:00:00,
width=6.5in,
xlabel style = {yshift=4mm,anchor=east},
x tick label style={
rotate=45,yshift=-0.1cm,
anchor=east,font=\large\bfseries}
]
\addplot [line width=6pt] table[col sep=comma,header=false] {
2015-12-21 06:31:00, 0.5
2016-01-13 08:41:00, 0.5
};
\end{axis}
\end{tikzpicture}
\end{document}