Is there such a program for drawing graphs/diagrams? I am aware of graphviz and at first glance it appears very useful, but it is missing certain basic features such as specifying multiple rank orders (arrange left to right, top to bottom... see here) or subscripts/superscripts. It apparently allows for html formatting which in theory provides for subscripts/superscripts, but it does not seem to work. dot2tex attempts to make graphviz more LaTeX friendly, but the generated graphs are not as sharp, C style comments, which are valid in graphviz files, appear to conflict with LaTeX files, even when included as a doc file, and I, personally, can't figure out how to embed the graph as a figure as opposed to a dangling graph.

Is there a way to address some of these shortcomings:

no sub/superscripts

no figures

no comments

If not, is there a way to output the file to a more LaTeX friendly format, much like gnuplot does with its latex format, such that I can use LaTeX's math mode?

EDIT here are two pictures to better describe what I mean by graphs and/or diagrams

3 Answers
3

As the commenters mentioned, TikZ can do these graphics and use the full power of LaTeX. A main advantage is that, unlike pstricks, the package works for all output drivers, most notably PS and PDF. Everything will compile with just one (or two) latex/pdflatex run(s), no extra setup required. Not to mention the plethora of features described in the excellent 700+ pages manual (with tutorial).

That manual should be slapped in the face of every first year computer scientist until they adopt its style entirely! I have never seen a tutorial that great. Not on w3schools, not on wikipedia, not even in strategy guides. +1,000,000
–
pukFeb 2 '12 at 21:01

The best tool is John Hobby's MetaPost, that can use a TeX engine (with whatever format: plain, LaTeX, and so on) [or by the way a troff engine too...] for the layout of "labels", and propose all the features of a programming/scripting language METAFONT like with a PostScript output. I use this for almost all my drawings; and to create easily legends and layout for maps---MetaPost can be considered as a PostScript scripting language too; so really handy to program the customization of maps.

MetaPost is a fantastic tool. To be found in, I think, all the TeX distributions---and of course: kerTeX.

The caveat is that to "see" the result, one needs a PostScript interpreter---while with METAFONT, you have also a rasterizer. (I even think that it could be useful in the future, for kerTeX, whether to develop a "MostScript", that is a PostScript limited interpreter able to render MetaPost figures; or to add back the rasterizing capabilities of METAFONT in MetaPost to be free from the need of a PostScript interpreter (software or "hardware" [printer]).