3

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.

3

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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