1

Help me to write the code of given figure in Latex.

enter image description here

MattAllegro
  • 6,455
  • 5
  • 45
  • 52
sania
  • 11
  • 2

2 Answers2

1

To give you something to start with:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
    
\begin{tikzpicture}
    \fill[blue,draw=black] (0,0) arc [start angle=180, end angle=0, radius=6];
    \fill[violet,draw=black] (0,0) arc [start angle=180, end angle=0, radius=5];
    \fill[red,draw=black] (0,0) arc [start angle=180, end angle=0, radius=4];
    \fill[orange,draw=black] (0,0) arc [start angle=180, end angle=0, radius=3];
  \fill[yellow,draw=black] (0,0) arc [start angle=180, end angle=0, radius=2];
  \foreach \x in {0,...,6}{
    \node at (2*\x,-0.3) {\x};
  }
\end{tikzpicture}   
    
\end{document}

enter image description here

1

My version with some cycles:

\documentclass[border=5mm]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \foreach \n in {0,...,6} \node [below] at (\n,0) {$\n$};
  \foreach \m/\c in {6/0,5/25,4/50,3/75,2/100}%
    \filldraw [black,fill=lime!\c!blue] (\m,0) arc(0:180:.5*\m) -- cycle;
  \foreach \n in {1,...,5} \node [above] at (\n+.5,.1) {$\mathcal{U}_{\n}$};
  \draw (0,0) -- (7,0);
  \draw (1,.08) -- (1,-.08);
\end{tikzpicture}
\end{document}

screenshot of output

MattAllegro
  • 6,455
  • 5
  • 45
  • 52