2

I created this figure with microsoft powerpoint but I'd like to make a similar one using latex because I am writing my document in latex. enter image description here

I already asked how I can make similar maze structure but in the response it is hard to remove some part of periphery to keep the red region without removing the whole circle. It would be even better structure if the extra light blue space between 2,3,4,5,7 steps will be removed and only the corresponding cells and middle region remain. I appreciate if someone suggest how I can modify the previous answer to get this image or with mentioned changes.

Thanks

2 Answers 2

3

I let the author of the previous answer modify his figure because I didn't follow the same way to build this figure. As I didn't quite understand everything you want, here is a first approach.

  • I use nodes, 3 in the form of a circle, 3 in the form of a pentagon. The latter are used to place the text at the top of these pentagons.
  • The radii of the circles are set, by modifying these parameters, everything is calculated automatically.
  • Not having recognized the font you used, I didn't write the text. If you have any questions, I'm listening.

Translated with www.DeepL.com/Translator (free version)

Update

screenshot

\documentclass[tikz,border=5mm]{standalone}
%\usepackage{tikz}
\usetikzlibrary{shapes.geometric,calc}
\begin{document}
\def\ultrad{60mm}
\def\bigrad{45mm}
\def\smallrad{30mm}

\def\pentasmall{20mm}

\begin{tikzpicture}
\node[name=cercle3,shape=circle,minimum width=\ultrad] {};%invisible circle
\node[name=cercle2,shape=circle,minimum width=\bigrad] {};
\node[name=cercle1,shape=circle,draw=cyan!30!violet,fill=cyan!60!violet!40,minimum width=\smallrad] {};
% 3 pentagon used to place text at their corner
\node[name=penta1, shape=regular polygon,rotate=108,draw=cyan!50!violet,
fill = blue!80!violet!20, inner sep=.5cm,minimum width=\pentasmall]
{};
\pgfmathtruncatemacro\pentamed{(\bigrad+\smallrad)/2}
\node[name=penta2, shape=regular polygon,inner sep=0pt,minimum width=\pentamed,rotate=108]{};
\pgfmathtruncatemacro\pentabig{(\bigrad+\ultrad)/2}
\node[name=penta3, shape=regular polygon,inner sep=0pt,minimum width=\pentabig,rotate=108]{};

\node[align=center] at (penta1){Start\\  1};
\foreach \i [evaluate=\i as \j using \i+24]in {-30,42,...,320}{
    \draw (cercle1.\i)--(cercle2.\i)arc[start angle=\i,end angle=\j,radius=\bigrad/2] (cercle1.\j)--(cercle2.\j);}
%\foreach \i/\j in {-90/2,-18/{R\\3},54/5,126/7,198/4}
%    \node[align=center] at ($(cercle1.\i)!.5!(cercle2.\i)$){\j};

\node[align=center,rotate=108] at (penta2.corner 1){J\\4};
\node[align=center] at (penta2.corner 2){2};
\node[align=center] at (penta2.corner 3){3};
\node at (penta2.corner 4){5};
\node at (penta2.corner 5){7};

% red 
\draw[fill=red](cercle2.42)--(cercle3.42)arc[start angle=42,end angle=66,radius=\ultrad/2]--(cercle2.66)arc[start angle=66,end angle=42,radius=\bigrad/2];
\draw[fill=red](cercle2.114)--(cercle3.114)arc[start angle=114,delta angle=24,radius=\ultrad/2]--(cercle2.138)arc[start angle=138,delta angle=-24,radius=\bigrad/2];

\end{tikzpicture}

\end{document}

Old answer

enter image description here

\documentclass[tikz,border=5mm]{standalone}
%\usepackage{tikz}
\usetikzlibrary{shapes.geometric,calc}
\begin{document}
\def\ultrad{60mm}
\def\bigrad{45mm}
\def\smallrad{30mm}

\def\pentasmall{1cm}
\tikzset{
shape example/.style= {color = black!30,
draw=cyan!50!violet,
fill = blue!80!violet!20,
very thick,
inner xsep = 2.5cm,
inner ysep = 0.5cm,
rotate=108}
}
\begin{tikzpicture}
\node[name=cercle3,shape=circle,minimum width=\ultrad] {};%invisible circle
\node[name=cercle2,shape=circle,draw,fill=cyan!20,minimum width=\bigrad] {};
\node[name=cercle1,shape=circle,draw=cyan!30!violet,fill=cyan!60!violet!40,minimum width=\smallrad] {};
% 3 pentagon used to place text at their corner
\node[name=penta1, shape=regular polygon, shape example, inner sep=.5cm,minimum width=\pentasmall]
{};
\pgfmathtruncatemacro\pentamed{(\bigrad+\smallrad)/2}
\node[name=penta2, shape=regular polygon,inner sep=0pt,minimum width=\pentamed,rotate=108]{};
\pgfmathtruncatemacro\pentabig{(\bigrad+\ultrad)/2}
\node[name=penta3, shape=regular polygon,inner sep=0pt,minimum width=\pentabig,rotate=108]{};

\node[align=center] at (penta1){Start\\  1};
\foreach \i [evaluate=\i as \j using \i+24]in {-30,42,...,320}{
    \draw (cercle1.\i)--(cercle2.\i);
    \draw (cercle1.\j)--(cercle2.\j);}
%\foreach \i/\j in {-90/2,-18/{R\\3},54/5,126/7,198/4}
%    \node[align=center] at ($(cercle1.\i)!.5!(cercle2.\i)$){\j};

\node[align=center,rotate=108] at (penta2.corner 1){J\\4};
\node[align=center] at (penta2.corner 2){2};
\node[align=center] at (penta2.corner 3){3};
\node at (penta2.corner 4){5};
\node at (penta2.corner 5){7};

% red 
\draw[fill=red](cercle2.42)--(cercle3.42)arc[start angle=42,end angle=66,radius=\ultrad/2]--(cercle2.66)arc[start angle=66,end angle=42,radius=\bigrad/2];
\draw[fill=red](cercle2.114)--(cercle3.114)arc[start angle=114,delta angle=24,radius=\ultrad/2]--(cercle2.138)arc[start angle=138,delta angle=-24,radius=\bigrad/2];

\end{tikzpicture}

\end{document}
3
  • I want that remove the curve line between 2,3,4, 5,7 cells and basically it looks like more a star shape but with two bigger arms. Does it make sense? The same as you did here compared to the previous answer but with inner cells. no line connects outer parts of 2,3,4.
    – Dalek
    Oct 26, 2020 at 17:38
  • @Dalek I don't know if I understood correctly, does this now correspond to your expectations?
    – AndréC
    Oct 26, 2020 at 18:51
  • yeah it is thanks
    – Dalek
    Oct 26, 2020 at 19:23
3

Another option. In this case, outer segments are drawn with arcs. If you don't want the border, they could be drawn with just an arc with the correct line width.

As a first solution all angles are defined by hand, but it's not too difficult to define them automatically.

\documentclass[margin=3mm, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, intersections, decorations.text}
\begin{document}

\begin{tikzpicture}
    \node [circle, minimum size=6cm, draw, draw= blue!20!black,fill=blue!20] (a) {} ;
    \node [draw,minimum size=4cm,inner sep=0pt,regular polygon,regular polygon sides=5,shape border rotate=180, align=center, fill=blue!80] (b) {Start\\ 1};
    \foreach \i [evaluate=\i as \j using 30+\i] in {39,111,183,255,327}{
    \draw[fill=cyan] (\i:3) arc (\i:\j:3)--++(\j:1) arc(\j:\i:4)--cycle;
    \draw[fill=red] (\i:4) arc (\i:\j:4)--++(\j:1) arc(\j:\i:5)--cycle;
    }
    \foreach \i [count=\ni] in {54,126,...,342}{
        \node[rotate=\i-90] at (\i:3.5) {\ni};
        \node[rotate=\i-90] at (\i:4.5) {\ni};
    }           
    
\end{tikzpicture}

\end{document}

enter image description here

Update:

\documentclass[margin=3mm, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, intersections, decorations.text}
\begin{document}

\begin{tikzpicture}
    \node [circle, minimum size=6cm, draw, draw= blue!20!black,fill=blue!20] (a) {} ;
    \node [draw,minimum size=4cm,inner sep=0pt,regular polygon,regular polygon sides=5,shape border rotate=180, align=center, fill=blue!80] (b) {Start\\ 1};
    
    \foreach \i [evaluate=\i as \j using 30+\i] in {39,111,183,255,327}
        \draw[fill=cyan] (\i:3) arc (\i:\j:3)--++(\j:1) arc(\j:\i:4)--cycle;
    \foreach \i [count=\ni] in {54,126,...,342}
        \node[rotate=\i-90, ] at (\i:3.5) {\ni};        
    
    \foreach \i [evaluate=\i as \j using 30+\i] in {39,111}
        \draw[fill=red] (\i:4) arc (\i:\j:4)--++(\j:1) arc(\j:\i:5)--cycle;
    \foreach \i [count=\ni] in {54,126}
        \node[rotate=\i-90, ] at (\i:4.5) {\ni};
            
\end{tikzpicture}

\end{document}

enter image description here

6
  • @lgnasi great but is it possible to remove extra cells on top of 3,4,5?
    – Dalek
    Oct 26, 2020 at 19:14
  • @Dalek Please, look at updated solution.
    – Ignasi
    Oct 27, 2020 at 7:51
  • how is it possible to change the labels in the cells because I can't find in the code where we can manipulate them?
    – Dalek
    Nov 11, 2020 at 15:58
  • 1
    @Dalek I used the foreach (\ni) to fill the cells, but you can forget it and use independent nodes to put whatever you want inside them.
    – Ignasi
    Nov 11, 2020 at 16:23
  • @Ignais Thanks for answering my question if you don't mind I have another question: how can i change the color of 3rd cell or just one of the red cells to other color? Thanks :)
    – Dalek
    Nov 11, 2020 at 18:32

You must log in to answer this question.

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