Wiki
Community
The question is
> Suppose I wish to add some graphics to my document. Which tool should I use?

The list of suspects is long, and certainly a single user cannot do full justice to all tools. This list includes (apart from using \includegraphics, which we do not consider here)
* Asymptote
* Ipe
* l3draw
* MetaPost
* pgfplots
* pictex
* picture environment
* PSTricks
* Ti*k*Z

We will discuss the following properties:
* external? That is, does one need external tools to use this tool? Please note that if a tool does not require external tools, it does not mean that you can always submit its source code to the arXiv (see the discussion below).
* 3d support? That is, to which extent are 3d-like features such as projections, ordering, lighting and so on supproted?
* restrictions?
* special features?

### Asymptote

**external**: yes, you need to compile the figures with asy.

**3d support**: among all the tools here asymptote has probably the most substantial 3d support.

**restrictions**: The more advanced 3d features may not be available for vector graphics support. The stronger the graphics card, the better.

**special features**: can access the outline paths of characters and texts, and thus produce impressive results such as [this one](http://www.piprime.fr/files/asymptote/odoc/Klein.png).

**further reading**: texdoc asympote, [base](https://github.com/vectorgraphics/asymptote/tree/master/base)
, [this tutorial](https://asymptote.sourceforge.io/asymptote_tutorial.pdf), [this gallery](http://asy.marris.fr/asymptote/index.html) and [this gallery](http://www.piprime.fr/asymptote/).
### Ipe

**external**: yes

**3d support**: no

**restrictions**: ?

**special features**: the better background, the better picture.

### l3draw

**external**: no

**3d support**: ?

**restrictions**: ?

**special features**: Experimental support based on expl3
ideas; inspired heavily by pgf but attempting to re-work
the backend and using the expandable FPU in expl3.

**further reading**: texdoc l3draw

### MetaPost

**external**: Yes, except for LuaLaTeX. You need to compile the figures with mpost or via packages such as gmp. LuaTeX has an embedded MetaPost library accesible via luamplib (LaTeX).

**3d support**: Limited, via packages such as featpost.

**restrictions**: It lacks native support for even-odd rule (specials are needed). MetaPost is better integrated with ConTeXt than LaTeX.

**special features**: Very fast. As a descendant of Metafont, MetaPost inherits most of its features, including font-making tools and solving of linear equations. Newer versions allow high-precision arithmetic. MetaPost produces PostScript, SVG and PNG output. Despite being old, the perhaps most comprehensive tool for producing Feynman diagrams is based on MetaPost. Using LuaLaTeX, the formidable Metafun macro package by Hans Hagen extends MetaPost functionality.

**further reading**: texdoc metapost, [this gallery](https://melusine.eu.org/syracuse/metapost/) (in French), [this gallery](https://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html) (also in French), [this manual from André Heck](https://staff.fnwi.uva.nl/a.j.p.heck/Courses/mptut.pdf) (in English), [Metafun manual](http://www.pragma-ade.com/general/manuals/metafun-p.pdf) for those interested in MetaPost for LuaLaTeX.

### pgfplots

**external**: no, plots get produced when compiling the LaTeX document.

**3d support**: yes, for single plots. but no realistic shading.

**restrictions**: relative 3d ordering of 3d plots is not supported as of now. inaccuracies at special values of trigonometric functions.

**special features**: pgf based and uses Ti*k*Z so benefits from pgf keys and can use all Ti*k*Z features.

**further reading**: texdoc pgfplots

### pictex

**external**: no.

**3d support**: no.

**restrictions**: very limited functionality.

**special features**: very fast.

### picture environment

**external**: no.

**3d support**: no.

**restrictions**: limited functionality, but great artists can overcome this

**special features**: inkscape has a special "tex+pdf" export option that will export all graphical elements as a pdf file and text elements in a picture environment. This is an easy way to ensure that labels etc. match the size and font style of the surrounding document

**further reading**: texdoc source2e (chapter "ltpictur") and also texdoc pict2e if you are willing to load the pict2e package.

### PSTricks

**external**: no

**3d support**: limited

**restrictions**: one has to produce postscript in one way or another, so does not work with pdflatex (unless one uses special tricks that do, however, not work on the arXiv, say) nor lualatex (some packages as pst-asr produce useless output). different compilation chains can lead to different results, e.g. xelatex vs ->dvi->ps->pdf. One also has to specify the size of the bounding box by hand.

**special features**: some support for the outline of characters. Many specialised packages build on PSTricks are available, most of which have counterparts in the Ti*k*Z world, but there are exceptions like optics packages (pst-opt, it is very ironic that so far there is no OpTi*k*Z package, is there?;-)).

**further reading**: texdoc pstricks, [this gallery](http://pstricks.blogspot.com/), [this gallery](https://melusine.eu.org/syracuse/pstricks/).

### Ti*k*Z

**external**: no

**3d support**: only projections, no ordering.

**restrictions**: may produce dimension too large errors, some special features such as graph drawing which rely on lualatex

**special features**: comes with the pgf key system, and probably the largest set of examples in the net. Many specialised packages build on Ti*k*Z are available. These packages include pgfplots, which is discussed separately, circuitikz which allows one to design circuits, tkz-euclide which has a large collections of constructions in Euclidean geometry, and of course the Ti*k*Zlings package which is indispensible in modern documents.

**further reading**: texdoc pgf, [texample](https://texample.net/tikz/examples/), on [tex.se there are more than 27k posts using Ti*k*Z/pgf](https://tex.stackexchange.com/questions/tagged/tikz-pgf), the main problem is not quantity but the quality and the ability to find the right post for the current task (as well as other challenges).

## Further considerations

There are certain aspects which one might want to consider on the long run. It might be worthwhile to mention some of them because users may not have them on their radar when making their initial choice.
* If one is to produce several graphics, it might be that tool A is a more convenient choice for some of the tasks and tool B more convenient for the other tasks. One then might want to weigh the convenience against the benefits of having a consistent appearance, e.g. the arrow heads may look different for different tools, etc.
* It is not unheard of that a graphics or plot from some paper or notes may make it into a beamer presentation, say. In this case tools that do not rely on external programs have the advantage that the fonts will automatically match. Of course, the price one may have to pay for this benefit is longer compilation time.
* Tools without external programs also make it easier to use macros in the annotations. In collaborations in which one uses macros to have uniform typesetting and/or acronyms, say, this is an advantage, the more so one can have hyperlinks from parts of the graphics to other parts of the document.
* If you want to submit to the arXiv, there are [various considerations that matter](https://arxiv.org/help/submit_tex). To be safe you want to make sure that your document can be compiled with pdflatex and only uses ASCII characters. While these requirements may change in the future, this currently means that many tools of the list above are not suited for arXiv submissions if you want to submit their source code. This also includes (to the best of the knowledge of the author of these lines) also PSTricks nodes that may be used to annotate the text. On the other hand, Ti*k*Z with \tikzmarknodes from the tikzmark libary should be supported. What you always can do is to compile the graphics to pdf files, which you can include via \includegraphics. Please also note that the arXiv folks are very friendly and supportive and can allow you to add special features if you contact them beforehand.


Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.