TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently generating data files which have points as follows

5 1
3 2
2 1.4

Each line 2 values of which the first is indicating the time and the second some value. I'm currently (as I'm working on the problem) plotting with gnuplot which works pretty well. I'm very new to TikZ and I was wondering how to get the data files in a plot where each datapoint is representated by a bar which I can put in my paper. Also I have another file that look something like this.

4.7 "some annotation"
3.4 "some other annotation"

I use these to annotate roughly each measurement. I would obviousle need to correct the x-coordinate (as this is the time and the measurement is not so precise) but I would like to somehow anotate each of the bars in the plot.

share|improve this question
up vote 3 down vote accepted

You can use pgfplots for this. It's a very powerful package that allows you to easily create a wide variety of plot types.

If you have a file called data1.csv in your folder, you could create a bar plot using


\begin{axis}[ybar, ymin=0]
\addplot table {data1.csv};


share|improve this answer
This is PERFECT! thank you so much! – Silverrocker Jun 19 '12 at 22:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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