Possible Duplicate:
pgfplot: Datafile format for datetime field
The solution to the following problem is probably very straightforward, but I've yet to find the right solution.
I'm trying generate a plot from data consisting of 358 lines looking like this:
2011-12-02 02:00:00, 14.43
2011-12-02 04:00:00, 4.49
2011-12-02 06:00:00, 12.33
2011-12-02 08:00:00, 4.23
2011-12-02 10:00:00, 2.49
2011-12-02 12:00:00, 2.26
2011-12-02 14:00:00, 2.32
I'm using the following code to generate the plot:
\documentclass{article}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{dateplot}
\pgfplotstableread{/home/user/data/csv/servername.cpud3}
\cputable
\begin{tikzpicture}
\begin{axis}
[
axis background/.style={fill,bottom color=gray!50,top color=white},
grid=major,
grid style={dotted,black},
width=15cm,
height=8cm,
date coordinates in=x,
date ZERO=2011-12-02 02:00:00,
xmin =2011-12-02 02:00:00,
xmax =2011-12-31 20:00:00,
xtick=data,
minor tick num=12,
ymax =100,
ylabel=\%,
xticklabel style={rotate=90, anchor=near xticklabel}
]
\addplot[ycomb] table[ y index = 2 ] from \cputable ;
\end{axis}
\end{tikzpicture}
This produces the following graph:

How do I get the data to be plotted for every second hour instead of days without changing the xticklabels?
Jake's comment below solved my problem.
Working example:
\documentclass{article}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\pgfplotstableread[col sep=comma]{/home/user/data/csv/server.cpud3}
\cputable
\begin{tikzpicture}
\begin{axis}
[
axis background/.style={fill,bottom color=gray!50,top color=white},
grid=major,
grid style={dotted,black},
width=15cm,
height=8cm,
date coordinates in=x,
date ZERO=2011-12-02 02:00:00,
xmin =2011-12-02 02:00:00,
xmax =2011-12-31 20:00:00,
xtick=,
minor tick num=12,
ymax =100,
ylabel=\%,
xticklabel style={rotate=90, anchor=near xticklabel}
]
\addplot[ycomb] table[ y index = 1 ] from \cputable ;
\end{axis}
\end{tikzpicture}
\end{document}
\addplotcommand. I've tried to reproduce your result, but for me, the data is plotted correctly. Note thatxtick=datais almost definitely not what you want in this case, since it would generate a tick for every data point. Could you try to create a full minimal example? – Jake Jan 12 '12 at 11:32\pgfplotstableread[col sep=comma]...? – Jake Jan 12 '12 at 11:36