# Diagrams

### of the kind I need, a practical guide to the creation thereof

On the art and science of algorithmic line drawings.

## Awesome examples

Gallery of concept visualisation: gallery of methods for explaining complex ideas; everything from exotic 3d stuff to crayon drawing and sticks.

## The tedious details of making awesome examples

Sketching vector diagrams for your reports. More painful than it should be.

Here’s the stackexchange list.

Here’s my list, in fluctuating descending order of priority

• draw.io is a browser-based diagram editor integrated into jupyter

• plotdevice is an active cousin of nodebox, targetting 2d vectory-printable stuff.

• ipe has, if not a completely intuitive interface, the closest I have seen to an intuitive scientific sketch program interface. It’s simple to learn, although has some oddities - e.g. you change the page size by creating and importing an XML stylesheet. Riiiight.

Also, it can’t export SVG, merely PDF and EPS, each of which are not so much vector graphics standards, as the battleground beneath the standards behind which the armies of various software corporations clash.

Anyway, push through; it’s worth it.

Ipe’s main features are:

• Entry of text as LaTeX source code. This makes it easy to enter mathematical expressions, and to reuse the LaTeX-macros of the main document. …
• Produces pure Postscript/PDF, including the text…
• It is easy to align objects with respect to each other (for instance, to place a point on the intersection of two lines, or to draw a circle through three given points) using various snapping modes…

That last point sounds minor, but it is an ingenious move that makes all the other terrible design choices worthwhile. Anyone who has every spent 90 minutes on doing trigonometry to get a pstricks diagram right, and wondered what happened to the thing where computers eliminated drudge work, you will weep upon the sight of it.

Built-in Lua scripting, like everything on the planet.

Integrates with matplotlib

Handy user contributions by Stefan Huber.

See pdf2svg to export the PDFs to other formats.

• If you really like clever layout, you might enjoy the declarative “compositional layout” diagramming style, as seen in Grammar-of-graphics tools. These do layout like, loosely put, CSS minus the cruft. Compose.jl provides these for Julia. Diagrams is the Haskell version. R’s grid is purportedly somewhat similar.

• pencil is a fashionable tool for GUI design that happens to be good for some other tricky things, notably flow charts. It’s built as a browser app so has good compatibility with export and presumably good hackability.

• Dia has some neat features; and many confusing ones I can’t imagine the use-case for. if you need to produce specialised diagram types for your project manager, Dia probably has the function. That’s not my area, but it’s nice that it exists.

Dia supports more than 30 different diagram types like flowcharts, network diagrams, database models. More than a thousand readymade objects help to draw professional diagrams. Dia can read and write a number of different raster and vector image formats. $…$ Dia can be scripted and extended using Python.

Crashes on my recent OSX, though, and I can’t be arsed working out why.

• matplotlib etc. Kind of ugly, but if you are already coding in python, you may as well. Here’s a surprising Matplotlib vector integral example

• Inkscape can do everything, although I find its Adobe Illustrator pretensions (perhaps unfairly) grating. Aimed at general graphic design, which makes it awkward for sciency stuff.

• Asymptote >Asymptote is a powerful descriptive vector graphics language that >provides a natural coordinate-based framework for technical drawing. >Labels and equations are typeset with LaTeX, for high-quality >PostScript output.

Might be good; haven’t used it. Has a jupyter extension

• PGFPlots is a LaTeX-native diagramming/plotting package which supports PDF output. It is a less awful (although still unwieldy) successor to…

• pstricks/tikz. The classic type-your-diagram-in-then-work-out-what-went-wrong option. I like the idea, but the practice, no. Elegant, powerful, and unless you happen to be doing exactly the right kind of diagram, tedious. Doesn’t support PDF output AFAICT.

• latexdraw Java pstricks GUI. Might be good, but I couldn’t install the damn thing.

• xfig combines the imprecision of drawing through GUIs, with the abstruseness and fragility of drawing through code. Listed here for the surpassing beauty of its manual page.

• pdf2svg is handy used in conjunction with (almost) any of the above programs to convert between formats.

• left-field: See the animation options under presentations

Notice there are no commercial entrants in this race?

I’m too poor for any Autodesk product, and unconvinced of their utility unless I wish to build some kind of major concrete structure.

I did buy Omnigraffle, the much-touted diagram editor for OSX. What a disaster; expensive, unintuitive, over-engineered. Like they ripped off xfig, took out the API and compensated for it by putting bezels on the icons. If you want to waste hours with horribly inscrutable drafting products, there are many open-source options available that can give your that experience for free.

## Matplotlib masterclass

The default matplotlib stylesheet aspires to look like 80s spreadsheet defaults, but if you are not a retrofuturist, you want to change the stylesheet. Some of the built-in stylesheets are OK.