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.
Share
That sounds like an easy job for the
pgfplotspackage. Section 4.5 from the manual contains a lot of examples to start from, everything is explained from scratch and step-by-step. If you need morepgfplotsexamples, 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 :).