I am trying to plot a Gantt-like chart with pgfplot from a CSV-File. The aim is to display the behavoir of a task scheduler. In my CSV-File I have tupel of timestamp(x) and task ID(y).
\documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents}{data.csv}
x,y
8868932,10
8868949,9
8868985,10
8868995,34
8869924,4
8869969,10
8869987,9
8870023,10
8870033,18
8870043,34
8870915,1
8870949,4
8871062,10
8871079,9
8871115,10
8871125,23
8871147,34
8871890,4
8871920,10
8871937,9
8871973,10
8871983,26
8872878,10
8872896,9
8872932,10
8872941,11
8872980,26
8873862,10
8873879,9
8873915,10
8873925,18
8873935,26
8874281,34
8874632,26
\end{filecontents}
\begin{document}
\begin{figure}
\begin{tikzpicture}[
font=\sffamily \footnotesize
]
\begin{axis}[
grid = major,
scaled ticks=false,
symbolic y coords={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34},
ytick={1,...,34},
height=12cm,
width=15cm,
x tick label style={rotate=90,anchor=east},
]
\addplot[
only marks,
mark=square,
scatter,
] table [x=x, y=y, col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
Every data point indicates which task was active. But instead to show only the point the task was scheduled I like to display the period of time the task was active. So the mark at each point needs to have a width relative to the differnce of the next timestamp and this timestamp. Is there any possibility to do this with pgfplot? Or do you have any other idea to display a gantt-like chart with this given data?
Thank you very much

8868932,10 8868949,9 8868985,10 8868995,34 8869924,4 8869969,10six rows in your data table, what would be the expected outcome? – Gonzalo Medina Sep 06 '15 at 22:20