0

Is there any way to make these similar diagrams look more beautiful, by adding special designs, colours, etc.? I'll really appreciate if I can be helped out.

enter image description here enter image description here

\documentclass[a4paper, 12pt, openany]{book}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw (0,0) circle (4cm);
\draw (0,0) circle (3cm);
\draw (0,0) circle (2cm);
\node (a) at (0, 0) {GROUPS};
\node (b) at (0, 2.4) {RINGS};
\node (c) at (0, 3.5) {FIELDS};
\end{tikzpicture}




\begin{tikzpicture}
\draw (0,0) circle (5cm);
\draw (0,0) circle (4cm);
\draw (0,0) circle (3cm);
\draw (0,0) circle (2cm);
\node (a) at (0, 0) {GROUPOIDS};
\node (b) at (0, 2.3) {SEMI-GROUPS};
\node (c) at (0, 3.5) {MONOIDS};
\node (c) at (0, 4.5) {GROUPS};
\end{tikzpicture}
\end{document}
2
  • These are Euler diagrams and not Venn diagrams.
    – dexteritas
    Commented Feb 12, 2023 at 10:15
  • Did you try adding specs to your circles? Like \draw[fill=cyan]...
    – SebGlav
    Commented Feb 12, 2023 at 10:31

1 Answer 1

3

Adaptations

  • define some colors using \colorlet{euler1}{red} etc.
  • use these color to define fill and text colors

Result

enter image description here

Code

\documentclass[a4paper, 12pt, openany]{book}

\usepackage{xcolor}
\usepackage{tikz}

\colorlet{euler1}{red}
\colorlet{euler2}{blue}
\colorlet{euler3}{yellow}
\colorlet{euler4}{green}

\begin{document}

\begin{tikzpicture}
    \draw[fill=euler1!20] (0,0) circle (4cm);
    \draw[fill=euler2!20] (0,0) circle (3cm);
    \draw[fill=euler3!20] (0,0) circle (2cm);
    \node[euler3!30!black] (a) at (0, 0) {GROUPS};
    \node[euler2!30!black] (b) at (0, 2.4) {RINGS};
    \node[euler1!30!black] (c) at (0, 3.5) {FIELDS};
\end{tikzpicture}

\end{document}

Automation

You could define a command for this kind of diagram, if it is always this structure:

\documentclass[a4paper, 12pt, openany]{book}

\usepackage{tikz}
\usetikzlibrary{calc}

\colorlet{euler1}{red}
\colorlet{euler2}{blue}
\colorlet{euler3}{yellow}
\colorlet{euler4}{green}

\newcommand{\draweuler}[1]{
    \foreach \xname [count=\i] in {#1} {\xdef\n{\i}}
    \foreach \xname [count=\i] in {#1} {
        \draw[fill=euler\i!20] (0,0) circle ({(\n-\i+2)*10mm});
        \node[euler\i!30!black] (g\i) at (0, {ifthenelse(\i==\n, 0, (\n-\i+1.4)*10mm)}) {\xname};
    }
}

\begin{document}

\begin{tikzpicture}
    \draweuler{FIELDS, GROUPS, RINGS}
\end{tikzpicture}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .