Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
83 views
in Technique[技术] by (71.8m points)

Best way to draw a bar chart in LaTeX?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

That sounds like an easy job for the pgfplots package. 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 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 :).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...