0

I would be very grateful if someone could help me to make this picture or something close:

The three arrows are between $0$ and $3/9$, $2/9$ and $7/9$ and finally $6/9$ and $1$. The rectangle on the left and right are red but can have another color provided that they have the same color and the middle rectangle does not have the same color. It would be an illustration for an argument in a proof.

1 Answer 1

5
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{patterns.meta}
\usepackage[outline]{contour}
\contourlength{1pt}
\begin{document}
\begin{tikzpicture}[x=0.5cm]
 \foreach \X/\Color in {0/red,4/cyan,8/purple}
 {\draw[\Color,pattern color=\Color,pattern={Lines[angle=45]}] 
    (\X,-1) rectangle ++ (1,2);}
 \path (0,0) node{\contour{white}{$0$}} 
    foreach \X in {1,...,8}
     {(\X,0) node{\contour{white}{$\frac{\X}{9}$}}  }
     (9,0) node{\contour{white}{$1$}}   ;
 \path[<->] (0,-1.5) edge (3,-1.5) (6,-1.5) edge (9,-1.5)
  (2,-2) edge (7,-2);    
\end{tikzpicture} 
\end{document}

enter image description here

1

You must log in to answer this question.

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