1

I will need your help once more to draw the following number line using tikz:

enter image description here

Is there anyone that could help me produce the above? Thanks in advance!

1 Answers1

3

Et voilà:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\tikzset{mybrace/.style={decoration={brace,raise=1.8mm},decorate}}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\foreach \vertpos in {0,2}{
    \draw (0,\vertpos) -- (4,\vertpos);
    \foreach \pos/\descr in {0/0,1/y,2/{\frac{x+y}{2}},3/x,4/1}
        {
        \draw (\pos,\vertpos) -- ++(0,1mm);
        \draw (\pos,\vertpos) -- ++(0,-1mm);
        \node[yshift=-4mm] at (\pos,\vertpos) {$\descr$};
        }
}
\foreach \mycoord in {(0,2),(2,0)}
    \draw [mybrace] \mycoord -- node[above, yshift=2mm]{if $z$ here, then error } ++(2,0); 
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

CarLaTeX
  • 62,716