# Euler diagram

> Subsets drawn inside the sets that contain them, and a disjoint set beside them. A Venn and Euler diagrams example with its LaTeX source.

A Venn and Euler diagrams example in the TeXeR TikZ library: https://texer.org/library/set-diagrams/euler-diagram

Package: [Venn and Euler diagrams](https://texer.org/library/set-diagrams.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: euler diagram, subsets, sets

## Source

```latex
\begin{tikzpicture}[thick, every node/.style={font=\small}]
  \draw[fill=gray!10] (0,0) ellipse (4 and 2.2);
  \draw[fill=blue!15] (-1.3,-0.1) ellipse (2.1 and 1.5);
  \draw[fill=blue!35] (-1.6,-0.4) ellipse (1 and 0.7);
  \draw[fill=orange!25] (2.2,0) ellipse (1.1 and 0.9);
  \node at (0,1.85) {Animals};
  \node at (-1.3,0.95) {Mammals};
  \node at (-1.6,-0.4) {Dogs};
  \node at (2.2,0) {Birds};
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
\begin{tikzpicture}[thick, every node/.style={font=\small}]
  \draw[fill=gray!10] (0,0) ellipse (4 and 2.2);
  \draw[fill=blue!15] (-1.3,-0.1) ellipse (2.1 and 1.5);
  \draw[fill=blue!35] (-1.6,-0.4) ellipse (1 and 0.7);
  \draw[fill=orange!25] (2.2,0) ellipse (1.1 and 0.9);
  \node at (0,1.85) {Animals};
  \node at (-1.3,0.95) {Mammals};
  \node at (-1.6,-0.4) {Dogs};
  \node at (2.2,0) {Birds};
\end{tikzpicture}
\end{document}
```
