# What graphics packages are there for creating graphics in LaTeX documents?

What packages do you use and recommend for creating graphics in your LaTeX documents?

As this is a community wiki post, please add your package to the accepted answer (or add a comment, and someone with >100 rep will add it to the CW answer), and include a brief description of what differentiates it from others and how it can be used (GUI drawing tool which generates code, type in raw text, or generates image for inclusion in document). We'll eventually sort these answers under headings.

-
possible duplicate of How do I insert an image in LaTex so it looks good on print? – John Gietzen Jul 26 '10 at 22:57
Agreed, even though the question is phrased differently, the answers are likely to contain the same information. – David Z Jul 26 '10 at 22:59
I wouldn't vote for a duplicate in this case. The other question concerned output quality and was essentially a case of vector vs. raster. This question is more likely to be a shootout between TikZ, PSTricks, MetaFun, Asymptote, etc. Probably should be community wiki as it is essentially a popularity contest. – Sharpie Jul 26 '10 at 23:17
Too vague, I feel. Graphics package for what? Are you just asking about how to \includegraphics? How to make graphs and plots? Or just a statistical survey of which packages are more popular. I think we should prefer questions that actually state a problem to be solved (how do I....) – jalf Jul 27 '10 at 1:27
No, this question has very specific answers, the set of graphics packages for LaTeX. This is a question which is a great use of the community wiki feature, and it should be left open to be edited as needed. – Kevin Vermeer Jul 29 '10 at 17:07

I've compiled this list. I don't have experience with most of these, but, if you do, please add more descriptive text to your package. If it does not appear, again, please add it. If you don't have the rep to edit, post it in a comment and @ messgage myself or the last editor. Also, if you feel that a certain element should not be in the list, remove it and leave a note in your edit explaining why it was removed.

The big ones:

#1 TikZ. The standard. As Dima said, it's "powerful, flexible, easy to use, and stunning"
#2 PStricks. Probably the second most used package.
#3 The default packages. More used than the others, but not by reason of being more powerful.

Other graphics packages and tools which create images suitable for inclusion in LaTeX documents include:

• Xy-pic - Best suited to graphs and diagrams, but capabilities for other formats.
• ePiX - Best for mathematical figures, creates PSTricks, tikz, or eepic macros.
• MetaPost - Similar to MetaFont, outputs PostScript files. Used by Knuth. Allows direct inclusion in a LaTeX file via the emp, gmp and mpgraphics package. MetaPost is now integrated in LuaTeX via the mplib library. Using LuaTeX, you can include your metapost figures directly in the TeX/LaTeX file with the luamplib package, without using any external software.
• MetaFun - An extension to MetaPost.
• Mfpic - A set of (La)TeX macros providing an interface to MetaPost (or METAFONT).
• LaTeXPiX - Windows GUI, exports PGF LaTeX code
• TPX - Another Windows GUI, more flexible outputs than LaTeXPiX
• Xfig - X-Window drawing tool, saves in its own .fig file, but outputs many formats (Including PS).
• Asymptote - A vector graphics language. Can embed LaTeX within the image. Outputs graphics for your document, not code. It can generate both 2D and 3D figures. 3D figures can be included in a pdf file in the PRC format which allows them to be manipulated when viewed in Adobe Reader.
• Inkscape - A very powerful and well-supported SVG editor.
• Ipe - A powerful vector graphics editor, with several snapping modes that make it especially suitable for variety of technical illustrations. Saves in its own .ipe file format, but outputs pdf and eps for inclusion in TeX documents. Uses LaTeX to typeset text, both labels and larger paragraphs. Supports layers and views, which make it possible to "build" illustrations incrementally in a presentation.
• Sweave - A tool that allows you to include R code directly into your LaTeX file. It does much more than just generate graphics, but it makes inclusion of R generated graphics into LaTeX document very easy.
• KtikZ,QtikZ - A PGF/Tikz real - time compiler for Debian/Ubuntu with KDE (it works with Qt also, and it has a new version for Windows, but I haven't tested it yet). It can speed up the drawing time while at the same time allowing to code directly in Tikz code. It has a template option which allows to define user commands in an easy way as well as a menu with many common (and not so common) TikZ constructs.
• GeoGebra - Award-winning free interactive geometry tool. As such it is also a vector graphics editor and a graph plotting software. Supports exporting to PSTricks, Tikz and Asymptote in addition to more traditional image formats. Available for major desktop and mobile platforms.
-
+1 for Asymptote. It seems to be a well-crafted, modern solution. And it supports 3-D. – Jared Updike Aug 3 '10 at 15:27

I would recommend TikZ. Powerful, flexible, easy to use & stunning quality.

See samples here http://www.texample.net/tikz/examples/

-
Note that this is a text-based drawing program. If you don't like manually editing coordinates, I'd recommend Ipe (see Neil Olver's answer) instead. – Timmmm Sep 18 '14 at 11:03

Ipe is by a long, long way my favourite program for technical drawings. For some reason, it's not so well known (at least, it took me a long time to find it). Very good LaTeX integration (you can enter LaTeX directly, and also specify a LaTeX preamble).

-

LatexDraw should also be mentioned as a graphic interface generating pstricks code. Very useful.

-
do you know if it is possible to enter equations in latexdraw? – David LeBauer Nov 15 '10 at 22:25
in order to draw a curve or to comment a curve? – pluton Nov 15 '10 at 22:48
in order to comment a curve – David LeBauer Mar 24 '11 at 15:50
you can add text content directly into LatexDraw and then edit the subsequent latex/pstricks source to meet your needs... – pluton Mar 24 '11 at 22:29

Dia, supports both pgf and pstricks output. It's free and open source. Supports GNU Linux and Windows OS

-

Sketch allows you to create drawings similar to TikZ, but in 3D. Additionally, it generates PGF/TikZ or PSTricks code. Here is an example, and there's an introduction.

-

My favorite drawing tool has already been mentioned: MetaPost, but I would like to mention the package that ultimately brought me to MetaPost: mfpic. It's a (La)TeX package which can interface both METAFONT and MetaPost. To the (La)TeX user who doesn't want to learn the intricacies of another language, it offers a friendlier way to use their drawing capacities.

A LaTeX file which contains mfpic coding needs several compilations for creating and including the picture: the first time for the main file with (La)TeX, the resulting METAFONT/MetaPost file must then be compiled with MetaPost, and a last compilation for the main file with (La)TeX. Once the picture is produced, this triple compilation is no more needed. Yet it is the main drawback of mfpic, which can be drastically reduced if you defer this triple compilation to a script, as I usually do.

Mfpic works equally well with (PDF)TeX or (PDF)LaTeX. It works also with Xe(La)TeX and Lua(La)TeX with some (minor) limitations concerning the labels.

Naturally, those who want to get still more "drawing power" from mfpic must learn something about METAFONT/MetaPost, since mfpic doesn't cover all of their possibilities by itself but allows the user to insert raw METAFONT/MetaPost code in their programs. This way I came to learn the MetaPost language little by little, and to use the MetaPost program itself more and more frequently. Currently I use MetaPost directly most of the time, but still revert to mfpic sometimes because it has some ready-to-use drawing macros (e.g. for tiling and extrapolation) that plain MetaPost (of its current extensions) does not offer.

Here are a very good introduction to mfpic by its current maintainer (Dan Luecking), and its complete reference manual.

-

A non-GUI option is GLE. It can be a little hard to use but for publication-quality data-driven graphs you can't really beat it. Here's a motivating example. I'm not sure how you'd create something like this that looks as good in any other package. It's possible in IPE but it can be tedious if you change the data and have to manually update the graph; with GLE you just re-run the command.

For diagrams rather than graphs, I'd use IPE every time.

Another option nobody has mentioned is Blender and its Freestyle line art options. Ok it doesn't output vector graphics, but for 3D stuff it works surprisingly well. It can even automatically dash hidden lines. Only downside I've found so far is that there's no easy way to insert a single line. You have to insert a plane and then mark one edge as a freestyle edge.

-
It's relatively easy to create data-driven graphs, such as the one above, using R, knitr (or Sweave), and, optionally, some additional packages, such as ggplot2, GGally, gridExtra. – Aleksandr Blekh Sep 12 '14 at 3:48
Sure. Probably better if you're already using R. If you're not, I think GLE looks better and is more flexible. – Timmmm Sep 15 '14 at 10:20
I'm not familiar with GLE, but I'm already using R for some time and, while the learning curve is somewhat steep, R ecosystem is amazingly rich, flexible and strong. – Aleksandr Blekh Sep 15 '14 at 10:31