Posted by: **Dave Richeson** | April 9, 2013

## Bubble diagrams for functions in LaTeX using TikZ

I am teaching Discrete Math this semester (our intro-to-proof course). One of the topics is functions. Not surprisingly my students and I have to draw “bubble diagrams” for functions between finite sets—and we have to include them in LaTeX documents. Rather than simply sketching them in Adobe Illustrator and importing them as graphics, I decided to try creating them in TikZ. After a lot of tinkering I came up with something pretty nice (see below). Moreover, I set it up so that all the complicated TikZ and LaTeX commands are in the header of the document. So my students and I can easily generate new bubble diagrams.

I’ve put a sample document on WriteLatex. If you click on this link you can get an editable copy of the document. You can edit it and it won’t change my copy—so go wild with it! (This cool feature of WriteLatex is described on their WriteLatex for Education page.)

### Like this:

Like Loading...

*Related*

Great! Thanks for doing this. Adding bubble diagrams to my notes was on my todo list.

By:

Dana Ernston April 9, 2013at 3:58 pm

Very nice.

By:

mathematruckeron April 9, 2013at 5:28 pm

[...] continuing my exploration of TikZ (here is my first post about TikZ). I will be showing my Discrete Math class how to “count” the positive rational [...]

By:

Countability of the rationals drawn using TikZ | Division by Zeroon April 16, 2013at 9:45 pm