# What software programs are used to draw physics diagrams, and what are their relative merits?

Undoubtedly, people use a variety of programs to draw diagrams for physics, but I am not familiar with many of them. I usually hand-draw things in GIMP which is powerful in some regards, but it is time consuming to do things like draw circles or arrows because I make them from more primitive tools. It is also difficult to be precise.

I know some people use LaTeX, but I am not quite sure how versatile or easy it is. The only other tools I know are Microsoft Paint and the tools built into Microsoft Office.

So, which tools are commonly used by physicists? What are their good and bad points (features, ease of use, portability, etc.)?

I am looking for a tool with high flexibility and minimal learning curve/development time. While I would like to hand-draw and drag-and-drop pre-made shapes, I also want to specify the exact locations of curves and shapes with equations when I need better precision. Moreover, minimal programming functionality would be nice additional feature (i.e. the ability to run through a loop that draws a series of lines with a varying parameter).

Please recommend few pieces of softwares if they are good for different situations.

-

## locked by David Z♦Jul 16 at 19:50

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

Related question on SO: stackoverflow.com/questions/4005042/… –  nibot Apr 4 '12 at 9:47

Look at SCaVis software. It has many examples illustrating how to draw various graphs. Here is the link to the examples

-

I'm learning TikZ (a drawing package for LaTeX) as we speak. It's good for two-dimensional line drawings, the syntax for specifying shapes and curves is extremely versatile, but the learning curve is steeper than LaTeX even.

There is a superb gallery of TikZ examples.

Here is another collection of neat TikZ examples on SE.tex.

-
It's worth noting that TikZ is far better documented than LaTeX as a whole, which IMO more than makes up for the learning curve. –  David Z Feb 13 '11 at 2:44
Actually, LaTeX is better documented: it's just that you have to buy the documentation. I disagree that TikZ' documentation makes up for the learning curve. It's extremely wordy, and the tutorial part doesn't structure the information so that you learn a basic framework first - you can't start making your own diagrams until you've been through a large portion of it. –  ptomato Feb 13 '11 at 9:00
Is it permitted for use in journal publications? –  Alex 'qubeat' Jul 20 '11 at 9:38
By the way, AIP has this to say about LaTeX: "While we appreciate the benefits to authors of preparing manuscripts in TeX, especially for math-intensive manuscripts, it is neither a cost-effective composition tool (for the volume of pages AIP currently produces) nor is it a format that can be used effectively for online publishing." (aip.org/pubservs/compuscript.html#prepare) –  ptomato Jul 20 '11 at 11:35
@ptomato: On the other hand, Physical Review and related journals prefer submissions in LaTeX (using revtex, of course). The part about using revtex is important, because it allows them to confidently processes manuscripts for web and print automatically. Accepting arbitrary LaTeX is hard, but accepting a large-but-well-defined subset is manageable. –  dmckee Nov 26 '11 at 22:25

For electric circuits, CircuitLab is a nice online editor and simulator. There are some restrictions to what you can do without an account or with a free account - I can't remember the details - but you can use print-screen to get nice pictures out of it. I like it because it is really at the level of simplicity I need: if I'm explaining a basic electric-circuits question, I do not want to spend more than two minutes drawing, say, five resistors in some parallel/series configuration. CircuitLab gets the job done.

For a tour, see their YouTube video Getting Started with CircuitLab.

Edit: If you want a png output to include in a post on this site, you can go over to Electrical Engineering, which has a built-in implementation in the post editor and simply bring back the image link. Thanks to Chris White for the tip!

-

You can also use PLotly, a collaborative, web-based graphing platform with APIs in Python, R, MATLAB, Julia, and Perl. You you can find the code to make these examples in their documentation.

.

-
Originally suggested by Matthew Sundquist –  Waffle's Crazy Peanut Dec 19 '13 at 12:06

I would try matplotlib, but first check here and decide if these pictures satisfies your needs. Also click some picture and inspect source code.

-
Those are some nice-looking pictures! I suppose I would have to learn Python, though. –  Mark Eichenlaub Nov 9 '10 at 8:09
@Mark : It's never to early to lear python ;) –  Frédéric Grosshans Dec 3 '10 at 16:57
It is only fair to mention that matplotlib is extremely similar to MATLAB: Similar user interface, similar capabilities, similar default styles, etc. One advantage of Matplotlib over matlab is that you get to use python, which is a better programming language than matlab. Another is that matplotlib is free, while matlab is prohibitively expensive unless you get it through work or school or pirated. On the other hand, MATLAB has better help files, easier installation, and a bigger scientific user base [but I hope those things will eventually change.] –  Steve B Nov 5 '12 at 20:49
I used matplotlib for many graphics in my thesis. The only downside is the lack of tex output. This meant I had to import my .svg files in Inkscape to add text an then export is as tex. –  BandGap Apr 26 '13 at 14:19

For drawing Feynman diagrams with SVG, I have developed jQuery.Feyn to make it easier (see the screenshot below).

-

I thought a lot about this question since I graduated and began teaching. I think Adobe Illustrator is the best vector image software. It doesn't require any code to draw images; you only have to learn to use some "important" tools. I'm in no way a graphic designer or a professional in Illustrator and I drew this:

Moreover,

1. you can always find tutorials about drawing anything with Illustrator
2. You can export images from Matlab or Autocad to Illustrator (.ai or .eps)

-
Perhaps you should also say a word about the principal drawback of adobe illustrator : it's price ! It's for professionals, not to make simple schemes. –  FraSchelle Jan 22 at 10:52

First of all do not use a raster graphics software like Gimp to draw pictures. This has serious disadvantages when you want to make screen readable documents (the picture pixelizes). For this purpose always use vector graphics. Wikipedia has a nice list of vector graphics software. Among them, I'd recommend the following:

• Inkscape (Cross-platform): Although the learning curve is a bit steep, its worth it. Note that Inkscape was not meant for making scientific diagram. Still you'll find a LaTeX plugin, export to LaTeX/PSTricks etc.

• Dia (Cross-platform): Very simple and easy, but not very powerful. Can't process LaTeX.

• Ipe (Cross-platform): Ipe is something in between Inkscape and Dia. Also Ipe was designed for scientific drawing. Can process LaTeX source code and import PDF figures.

• WinFIG (Cross-platform): Although commercial, its quite popular in the scientific community.

EDIT: Wikipedia has a nice page which discusses various software that can be used to create figures. See Wikipedia:How to create graphs for Wikipedia articles

-
+1 Very informative answer. –  ysap Nov 5 '12 at 18:58

There is an add-in for Microsoft Word called Science Teacher's Helper. http://www.helpscience.com

SmartDraw is also an excellent program for creating diagrams. http://www.smartdraw.com

-

I too use Mathematica for figures and found it wasn't a great leap from there to using it for drawings. You can draw 2D or 3D primitives pretty easily:

Rectangle[{xmin, ymin}, {xmax, ymax}]


and, like python/matplotlib, being able to parameterise everything allows you to redraw an image for multiple scenarios (or Animate or Manipulate it).

For me the most useful feature is that you can define things in terms of the maths. The MetaPost example mentioned by Marek, in which two curves can be defined and the intersection computed by the drawing package, is handled inherently by Mathematica.

-

Just for completeness, I'll leave this here:

It's always possible to compose your illustrations in raw postscript! Postscript is itself a Forth-like programming language. It's particularly useful for illustrations that lend themselves to being generated procedurally. If postscript itself is too low-level, one can often write a script in some other language that outputs a postscript program.

One superb introduction to producing drawings in raw postscript is this free book:

-
Nice book it seems. I have to check it out! –  71GA Jul 7 '13 at 9:53

I've had good experiences with Inkscape. It has a GUI interface, but allows you to enter coordinates directly if you want, and it's scriptable. There is a plug-in that allows you to enter LaTeX directly (for labels and such). The downside is that it is very much still in development, so sometimes you find that a feature you want is not completely implemented yet.

As an example, here is a poster I made last week, entirely within Inkscape:

Inkscape now also has the "JessyInk" plug-in which allows you to use it to make presentations (à la Powerpoint). The presentation can be viewed in a web browser as SVG, or exported to PDF.

## Success story

I used MP to create some polygons on a hexagonal lattice in the context of cluster expansions. There was a huge number of those polygons to draw, so I quickly abandoned all hope of trying to draw them by hand in Inkscape or something similar. True, it would probably be quicker in the end, but I hate manual work; I rather spend much longer learning some programming language and then just code all the work in few minutes. So I put together simple MP program that has converted my input data (vertices and edges of the polygons as just numbers) into beautiful images. For a one night's work and my first time with MP I was more than satisfied.

## Goodies

Credit for this amazing picture goes to Johan Kåhrström (go also see more stuff under illustrations there).

-
Excellent summary and example image! Thanks, Marek. –  Mark Eichenlaub Dec 23 '10 at 23:23
@Mark: I only now noticed that this was a community wiki and other answers are just few lines long. So I wonder whether this long answer is suitable here (I don't want to steal too much space just for myself). Still, seeing that you like it, it can probably stay :-) –  Marek Dec 23 '10 at 23:32
Beautiful example! –  nibot Jan 17 '11 at 16:29
I think TikZ can actually do all the things you mentioned in your list. –  David Z Jan 17 '11 at 19:42
Wow, the image is awesome. –  Juanlu001 Sep 12 '12 at 9:50

Related post in SO.

My personal favorite is Asymtpote which is like MetaPost on steroids. A gallery is here.

-
I read about Asymptote when I was deciding whether to learn MP or something else. Something put me off; whether it was C++-like syntax, only LaTeX support, or perhaps something else (I don't remember whether anything of this has to do with Asymptote or some other program anymore). Could you describe the differences with MP a little? I'd be all for learning Asymptote if it proves to be a better alternative. –  Marek Dec 23 '10 at 23:49
@Marek Wow this is an old thread, but it seems your question was never answered. I personally favor Asymptote, since it gives pretty much all the power of MP but with a much more streamlined syntax. I like it and I don't even like OO programming. Whatever geometric things you commonly draw probably already exist as very natural functions. Plus, it draws on LaTeX to make the labels typeset well. And if you so desire you can integrate Asy commands seamlessly into a Tex document by using the right package, though I prefer to keep them separate. Asy is definitely underappreciated. –  Chris White Nov 28 '12 at 2:02

For primitive drawings, I am a big fan of XFig. The UI is a little clunky, but it can save to dozens of graphics formats and creates figures that are downright trivial to include in a LaTeX document. The biggest thing for me is that the file format is text-based, so it is completely possible to script more complicated drawings.

-

To start with, for scientific drawing usually vector graphics is more suitable - scalable, convenient to modify and produce less bulky files.

For simple general-purpose graphics I use OpenOffice.org Draw (I prefer it to Incscape).

For abstract diagrams there is yEd - Graph Editor.

Both are free, for Win/Linux/MacOSX, easy to learn and can export to vector graphics and pdf.

-
1. Software for drawing geometry diagrams
2. Sometimes I use SAGE.
-
Thanks. Do you have any opinions beyond what's said in that thread? –  Mark Eichenlaub Nov 9 '10 at 6:44
No. Nothing beyond whats said! I use mspaint :) –  Pratik Deoghare Nov 9 '10 at 7:38

## protected by Community♦Jun 23 at 14:00

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.