# Is there a way to draw a graph (vertices & edges) in LaTeX on this website?

I googled and found how to do it in LaTeX software on your computer, but what about this website, possible to draw graphs as easy as writing out a matrix in LaTeX?

Failing that is there some website that will generate an image for you given the graph spec.

Thanks.

## migrated from math.stackexchange.comSep 23 '13 at 20:24

This question came from our site for people studying math at any level and professionals in related fields.

• No, I do not think so. Instead, you need to draw your graphs in LaTeX, save the picture (using a screenshot, say) and then upload that to here. – user1729 Sep 23 '13 at 20:25
• – Martin Sleziak Sep 23 '13 at 20:32
• (And for the record, use TikZ if you want to draw anything in $\LaTeX$. And I mean anything. Well, anything mathematical.) – user1729 Sep 23 '13 at 20:34
• If I thought there was even a remote chance that it would be satisfied, my number one feature-request would be tikz support for MSE. – Alexander Gruber Sep 23 '13 at 21:35
• @Alexander. I'd second that, since I use tikz for all the pictures I've posted (and lots of handouts for my classes), but you'd probably agree that tikz has a frightfully steep learning curve for novices. – Rick Decker Sep 26 '13 at 14:30
• Also this post on meta discusses creating and posting various kinds of diagrams on this site: meta.math.stackexchange.com/questions/9632/creating-diagrams (And you can find links to more such posts there.) – Martin Sleziak Nov 30 '14 at 6:49

Well, there are many ways to create a picture, and upload it here. Some of the more obvious alternatives are:

(1) MS Paint, GIMP, or other paint programs

(2) Illustrator, Corel, Powerpoint, Inkscape, or other vector drawing packages

(3) TikZ or MetaPost or Asymptote, if you think that writing code is a good way to create pictures.

(4) Mathematica, Maple, Matlab, or any other package with graphing capabilities

(5) Draw on paper, and scan

(6) Draw on a whiteboard (or even a blackboard), and shoot with a camera or mobile phone.

Options 5 and 6 give you a bitmap image directly. The other options will require you to generate one indirectly. A screen grab is usually the easiest way.

For graphs, I would recommend #2 or #5, personally.

• Please, don't use a point-and shoot camera or phone camera unless you're photographing something three-dimensional. – dfeuer Oct 24 '13 at 2:43
• @defeuer -- why is that? – bubba Mar 14 '14 at 4:04
• Because it produces images that tend to be even harder to read than proper scans of the same hand-scribbled notes. – dfeuer Mar 14 '14 at 19:16
• I personally like the draw on paper and scan the most and this will become more and more accessible until that's all we use. – BananaCats Category Theory App Dec 1 '14 at 16:20

If you know Mathematica syntax you can use Wolfram Alpha for simple graphs. Then post the image here:

Graphviz can draw graphs, and google charts API can do graphviz. See erdos for a tool that lets you use the API interactively.

Alternatively, you can use tikz, and a site like writelatex.com to render it.

When using either of these, I use imgur.com's browser plugin to rehost the image, and I use gist to save the source; I make sure to link the sources from my diagrams in my questions and answers.

Typically, I use <sup><\sup> to "caption" the images from underneath.

Another trick: when displaying multiple images, you can resize them to fit on the same row side-by-side; IIRC the width of the display is ~660 pixels (on at least on cs.SE; I hope it doesn't change!) - image hosting sites like imgur.com directly support simple image editing, like scaling and cropping - then I caption them underneath like "left: description, right: description".

Example:

Left: Full graph. Center: shortest path. Right: shortest non-intersecting path.

• Oh, please don't rely on a certain number of pixels in the display! – dfeuer Oct 24 '13 at 2:40
• You can put images side-by-side in $\LaTeX$ using \minipage – user1729 Oct 26 '13 at 13:41
• @dfeuer you can combine the images if need be lol. Or like user1729 suggested, you can combine them in LaTeX. – Realz Slaw Oct 28 '13 at 18:05
• @RealzSlaw: "This image you are requesting does not exist or no longer available". – d80d2729a352b1366139fc119d3345 Aug 30 '14 at 9:27
• @Moron true, but it doesn't really matter what the image is, the point is the captions. If it bothers you, you can edit in any image . – Realz Slaw Aug 31 '14 at 0:44
• the images no longer exist, can you lease edit that\$ – user153330 Sep 18 '15 at 21:14
• @user153330 done – Realz Slaw Sep 18 '15 at 21:32