124

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.

12
  • possible duplicate of How do I insert an image in LaTex so it looks good on print? Jul 26, 2010 at 22:57
  • 1
    Agreed, even though the question is phrased differently, the answers are likely to contain the same information.
    – David Z
    Jul 26, 2010 at 22:59
  • 4
    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, 2010 at 23:17
  • 2
    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, 2010 at 1:27
  • 6
    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. Jul 29, 2010 at 17:07

12 Answers 12

121

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 PGF/TikZ. The standard. As Dima said, it's "powerful, flexible, easy to use, and stunning". TikZ provides a high-level user interface. PGF provides lower-level macros.
#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. These are mostly useful for including external images (e.g. graphicx) or combined with other packages (e.g. xcolor is used by PGF/TikZ).

Other graphics packages and programmes typically included in TeX distributions include:

  • pgfplots a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. Supports but does not need external tools and addresses a wide range of data visualizations with high quality.
  • 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).

Independent GUI wrappers and tools which create images suitable for inclusion in LaTeX documents include:

  • 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, although code may be compiled as part of document compilation, with shell escape enabled. 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. Can be used to export TikZ code.
  • 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.
  • Knitr/Sweave - Tools that allow you to include R code directly into your LaTeX file. Sweave is the older utility and is part of base utils package in R. Knitr is a package that reimplements and extend the basic ideas in Sweave. They do much more than just generate graphics; they make inclusion of R generated graphics into a LaTeX document very easy.
  • KtikZ,QtikZ - A PGF/Tikz real-time compiler for GNU/Linux, based on Qt and designed to integrate into KDE 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.
3
  • 3
    +1 for Asymptote. It seems to be a well-crafted, modern solution. And it supports 3-D. Aug 3, 2010 at 15:27
  • Happy (and honored!) to have provided the 100th upvote on this great answer. :-)
    – Mico
    Nov 22, 2017 at 6:05
  • Are all of these links current? #1 is not.
    – Ken Ingram
    Nov 14, 2020 at 0:04
28

Depends on your particular needs.

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

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

1
  • 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, 2014 at 11:03
11

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).

7

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

6

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.

GLE example

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.

6
  • 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. Sep 12, 2014 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, 2014 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. Sep 15, 2014 at 10:31
  • I'm totally agree with Timmmm's option on the Blender and its FreeStyle rendering output, the output can be SVG images, but basically, if you want to draw some 3D graphics(not data-driven graphs), I think Blender is quite good, especially its FreeStyle output.
    – ollydbg23
    Apr 29, 2016 at 3:07
  • +1. GLE looks or rather looked very promising. The last version is from August 2015 and also the mailing list, bug tracker and so forth seems very inactive. Jul 4, 2017 at 17:35
5

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

4
  • do you know if it is possible to enter equations in latexdraw? Nov 15, 2010 at 22:25
  • in order to draw a curve or to comment a curve?
    – pluton
    Nov 15, 2010 at 22:48
  • in order to comment a curve Mar 24, 2011 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, 2011 at 22:29
4

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.

4

I like TikzEdt. It has more ability then LaTexDraw and Ipe.

enter image description here

2
  • I like TkzEdit and I think it's the best, too. Unfortunately, the project is not maintained anymore. :'( However, the package is tikz, TkzEdit is only an editor.
    – CarLaTeX
    May 22, 2017 at 10:45
  • I have listed some of the useful packages which allows to write scripts to make Graphics in LaTeX itself, they are: PSTricks, PDFTricks, and most reasonable one Tikz, etc...
    – MadyYuvi
    Aug 2, 2017 at 9:39
3

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.

0

diagrams is a domain-specific language for creating vector graphics using Haskell. It has several backends that allow for direct embedding into LaTeX files. As an example, take a look at the diagrams in Brent Yorgey's PhD thesis, that are all done with this library (you can see the examples in the pdf... jump to the diagrams linked in the List of Figures (the sources are available in the repository)).

It's pretty amazing! IMHO

0

Online WYSIWYG Mathematics Editor (Equation Editor), fast and powerful Editing features, inputting Normal text, Math symbols, and drawing Graph/Diagram in TikZ is https://www.mathcha.io/editor.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .