tags:

views:

64

answers:

3

Hi,

I want to draw a couple of simple bar plots to include in a LaTeX document.

For some reason (unless im missing something), there doesn't appear to be a simple way to generate bar plots in LaTeX.

I could of course generate them in Excel and save them as PDF, but I'd rather have the flexibility of doing them dynamically in LaTeX.

I looked into TikZ, but it seems nobody on the interwebs is using it for a measly barchart (which is what I need it for), and the code below generates a barplot without any axis:

\begin{tikzpicture}[scale=2]
\draw[ycomb, color=gray,line width=0.5cm] 
        plot coordinates{(1,1) (2,2) (3,3)};
\end{tikzpicture}

What do you use? Am I doing something horribly wrong?

A: 

I do not know if you're familiar with gnuplot, that can generate bar plots. There is a "TikZ terminal" (something that outputs TikZ-code) for gnuplot, however, as far as i know, you have to compile it yourself in order to get it working.

I think there's also another "LaTeX terminal" generating pstricks (?) code or something similar.

phimuemue
I think it's LatexDraw
Adrien
Sweet - this looks like what I think I need! Thank you!
Malang
A: 

I'd say you want pgfplots: this is built on top of Tikz as a proper plot-drawing interface.

Joseph Wright
Thanks Joseph, you're spot on. This is perfect.
Malang
No problem: I love `pgfplots`!
Joseph Wright
A: 

Can I point you towards Asymptote (Wiki, Gallery). You can make professional looking graphs offline from LaTex processing, but being LaTeX aware. It is a full blown C-ish language for vector graphics and function graphing. The output eventually is encapsulated postscript (eps) which can be displayed directly into LaTeX documents.

jalexiou