16

I've just started using LyX for my Economics essays. Using Inkscape, I have been able to create some very neat diagrams to go with them.

However I really need to be able to insert graphs (XY charts, bar charts, histograms etc.) into the document, preferably without having to go via excel. I don't need anything fancy, just something that works with LyX.

Caramdir
  • 89,023
  • 26
  • 255
  • 291

5 Answers5

19

pgfplots is phenomenal. It's also totally TeX based so you can import your data and plot in one fell swoop. The package author is very active and the syntax is very tikz-y, so it's easy to learn.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195
  • Very pleased with this suggestion. I'm afraid I haven't had time to try the other suggestions (but I'm sure they are equally as good). Many thanks for all responses! – Patrick Beardmore Nov 16 '10 at 00:15
  • I'm convinced that pgfplots is the best way to get high quality graphs in LaTeX. Modulo the negligible inconvenience of having to export your data from whatever created it. – Will Robertson Nov 16 '10 at 14:11
7

I would recommend you try and use matplotlib, which is a mature and extremely well designed plotting suite. It's aim is to produce paper quality graphics, so it can output in pdf, svg, eps formats, to name the most important. It also allows you to embed TeX math equations in your graphics.

It is coded in python, thus anything you learn about the language might be reusable. Don't worry though, it doesn't require you to master python. The link above points to the matplotlib gallery, which contains a whole lot of examples and their source code. Just pick one you like, swap datas for yours and bingo.

levesque
  • 12,993
  • 12
  • 43
  • 52
  • I suggest this as well, and maybe you can add matplotlib2tikz. It converts the matplotlib plot to pgfplots/tikz. It works great, the generated code is clean and the script is regularly maintained. – abdulhaq-e Mar 19 '13 at 22:25
3

You may be able to use the answers from this question: Function Graph in LaTeX

Jóhann
  • 1,845
1

Perhaps you can use Gnuplot. See here for a short description.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
0

For more complicated graphs, it might be worth looking into R and Sweave. Although I expect this will break LyX in a variety of interesting ways, but you LyX should only be a gateway to writing real LaTeX anyway...

Seamus
  • 73,242