4

I have a little diagram where I want to fill the ellipses.

\documentclass[border=3pt]{standalone}
\usepackage{tikz}

\begin{document}
\def\firstellipse{(0,0) ellipse (1 and .5)}
\def\secondellipse{(.7,.3) ellipse (2 and 1)}
\def\thirdellipse{(1,.6) ellipse (2.5 and 1.5)}
\def\fourthellipse{(1.3,.9) ellipse (3 and 2)}
\def\fifthellipse{(1.6,1.2) ellipse (3.5 and 2.5)}
\begin{tikzpicture}
\draw\firstellipse;
\draw\secondellipse;
\draw\thirdellipse;
\draw\fourthellipse;
\draw\fifthellipse;
\node at (0,0) {Körper};
\node at (.7,.75) {Euklidische Ringe};
\node at (1.2,1.6) {Hauptidealringe};
\node at (1.5, 2.37) {Faktorielle Ringe};
\node at (1.9, 3.2) {Integritätsringe};
\end{tikzpicture}
\end{document}

ellipses

The color should be different for each ellipse, I haven't worked it out entirely yet but probably something like:

  • first ellipse red!15

  • second ellipse green!15

  • third ellipse blue!15

  • fourth ellipse cyan!15

  • fifth ellipse magenta!15

However, I cannot use fill comands since only the non-intersecting parts should be filled with this color. I have used MS paint to show what I mean: paint

  • 6
    Change the order of the nodes and colors will be overprinted – percusse Aug 27 '17 at 9:40
  • Welcome to TeX.SX! – Bobyandbob Aug 27 '17 at 9:57
6

Just draw the ellipses in opposite order, starting with the largest:

\documentclass[border=3pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \def\firstellipse{(0,0) ellipse (1 and .5)}
  \def\secondellipse{(.7,.3) ellipse (2 and 1)}
  \def\thirdellipse{(1,.6) ellipse (2.5 and 1.5)}
  \def\fourthellipse{(1.3,.9) ellipse (3 and 2)}
  \def\fifthellipse{(1.6,1.2) ellipse (3.5 and 2.5)}
  \filldraw[fill=magenta!15]\fifthellipse;
  \filldraw[fill=cyan!15]\fourthellipse;
  \filldraw[fill=blue!15]\thirdellipse;
  \filldraw[fill=green!15]\secondellipse;
  \filldraw[fill=red!15]\firstellipse;
  \node at (0,0) {Körper};
  \node at (.7,.75) {Euklidische Ringe};
  \node at (1.2,1.6) {Hauptidealringe};
  \node at (1.5, 2.37) {Faktorielle Ringe};
  \node at (1.9, 3.2) {Integritätsringe};
\end{tikzpicture}
\end{document}

Result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.