\documentclass{standalone} \usepackage[svgnames]{xcolor} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{positioning,fit,backgrounds} \colorlet{colN}{OrangeRed!60} % color of set of Integers \colorlet{colZ}{Orange!60} % color of set of Rational numbers \colorlet{colQ}{Gold!60} % color of set of Real numbers \colorlet{colR}{ForestGreen!50} % color of set of Complex numbers \colorlet{colC}{CornflowerBlue!80} % color of set of Hypercomplex numbers \colorlet{colH}{BlueViolet!50} % color of set of Transcendental numbers \colorlet{colT}{Green!30} \newcommand\drawnestedsets[4]{ % initial position \def\position{#1} % number of sets \def\nbsets{#2} % list of sets \def\listofnestedsets{#3} % reversed list of colors \def\reversedlistofcolors{#4} % position and draw labels of sets \coordinate (circle-0) at (#1); \coordinate (set-0) at (#1); \foreach \set [count=\c] in \listofnestedsets { \pgfmathtruncatemacro{\cminusone}{\c - 1} % label of current set (below previous nested set) \node[right=1pt of circle-\cminusone,inner sep=0] (set-\c) {$\mathbb{\set}$}; % current set (fit current label and previous set) \node[circle,inner sep=-0.5,fit=(circle-\cminusone)(set-\c)] (circle-\c) {}; } % draw and fill sets in reverse order \begin{scope}[on background layer] \foreach \col[count=\c] in \reversedlistofcolors { \pgfmathtruncatemacro{\invc}{\nbsets-\c} \pgfmathtruncatemacro{\invcplusone}{\invc+1} \node[circle,draw,fill=\col,inner sep=0, fit=(circle-\invc)(set-\invcplusone)] {}; } \end{scope} } \begin{document} \begin{tikzpicture} \drawnestedsets{0,0}{5}{N,Z,Q,R,C}{colN,colZ,colQ,colR,colC} \end{tikzpicture} \end{document}