MA0001/Exercise 1/figures/5b.tex

21 lines
445 B
TeX

\begin{tikzpicture}
\begin{axis}[
xlabel = $x$, ylabel = $y$,
width = 10cm, height=10cm,
axis lines = middle,
grid,
xmin=-1.5, xmax=5.5,
ymin=-2.5, ymax=4.5,
legend pos=outer north east
]
\addplot+ [
no marks,
domain = 0.5:4.5,
]{abs(x-2)+1};
\addlegendentry{$y=|x-2|+1$}
\node[label={270:{(2,\ 1)}},circle,fill,inner sep=2pt] at (axis cs:2,1) {};
\end{axis}
\end{tikzpicture}