I know I could screen shot the pic, but it does not look as good. I would really like to learn how to do this more efficiently. I am trying to use quadratic equations, but as you can see my figure is incomplete. I hope it is possible. I also would love to know how to draw the f(x) label node with the arrow.
Any help would be appreciated.
Any help would be appreciated.
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{graphics}
\usepackage{graphicx}
\usetikzlibrary{hobby}
\pgfplotsset{compat=newest}
\tikzset{point/.style={circle,draw=black,inner sep=0pt,minimum size=3pt}}
\usetikzlibrary{arrows.meta}
\usepackage[labelformat=empty]{caption}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[grid style={gray!50}, thick,
xlabel={\(x\)},
ylabel={\(y\)}, xmin=-4,xmax=6,ymin=-5,ymax=5,
every axis plot/.append style={ultra thick},
axis y line=center,
axis x line=center,
axis line style={Triangle-Triangle},
ticklabel style={font=\small,fill=white},
yticklabels=\empty,
ytick=\empty
]
\addplot[thick,samples=1000,domain=-3:-2]{-2*(x+3)^2+2};
\addplot[thick,samples=1000,domain=0:2]{-(x-1)^2};
\addplot[thick,samples=1000,domain=-2:-1]{.5(x+1)^2-2};
\draw[thick, dashed] (-3,0)--(-3,2);
\addplot[thick,samples=1000,domain=3:5]{-(x-5)^2+2};
\draw[thick, dashed] (-3,0)--(-3,2);
\draw[thick,dashed] (5,0)--(5,2);
\draw[thick,dashed] (3,0)--(3,-3);
\draw[thick,dashed] (-1,0)--(-1,-2);
\end{axis}
\end{tikzpicture}
\caption{}
\end{figure}
\end{document}