views:

337

answers:

2

I was looking for it here in Stack Overflow as in Google, and I found a lot of packages to draw, but it seems a complex task, so I would like to know which is the most appropriate package to draw bars, and associate data to it. Also I was looking for a code example, but I did not have luck.

+5  A: 

That sounds like an easy job for the pgfplots package. Section 4.4.4 contains a lot of examples to start from, everything is explained from scratch and step-by-step. If you need more pgfplots examples, the section dedicated to plots at TeXample could be of interest. There aren't any bar plots, but it contains some nice (and more elaborate) examples of the functionality.

As for a code example, I could copy-and-paste one from the manual, but that would not add much to this post I believe.

Edit: when using Matlab, it is possible to use matlab2tikz. This way you can export your plots without having to worry about the actual code. Bar charts should be possible, but I haven't used that functionality yet so I don't know about any quirks. The plots I did export using this Matlab script were perfect and you get the consistency and flexibility you want :).

Pieter
+2  A: 

This might be viewed as sacrilege, but it's actually not that terrible to generate the plot using matlab, excel or any other tool, and merely include the PDF/jpg in. pgfplots is a more elegant option, but might not be the quickest.

Suresh
And lose the consistency, while `pgfplots` is such a good and not too difficult package? That would be a shame, don't you think? :) As per your suggestion of Matlab, I'll edit my post.
Pieter
couldn't add a comment up in your post. matlab2tikz sounds great !
Suresh
You'll need 50 reputation to do that. Answer some more questions, wait for upvotes and accepts and you'll get there quite fast :).
Pieter
I study Architecture, so I'm a little tired of graphic apps ^^Uu
Tae