Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

1 Answer 1

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

\documentclass{article}
\usepackage{pgfplots}

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

\end{document}

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

Your Answer

 
discard

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.