0

This question already has an answer here:

I would like help drawing a specific graph in LaTeX

enter image description here

marked as duplicate by Henri Menke tikz-pgf Mar 1 at 7:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    Please indicate what you have tried, and where you got stuck. The pgfplots package is suitable for this sort of problem. – Benjamin McKay Feb 28 at 19:49
  • 2
    welcome to tex.se! what you try so far? how you like to help? which package for drawing you like to use? – Zarko Feb 28 at 19:49
4

IMHO this is not a free hand graph.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=$x$, ylabel=$y$,ymax=4,ymin=-4,unbounded coords=jump,
 axis lines=middle,title style={at={(1,1)},anchor=north east},
 title={$y=f(x)$},xtick={-2,0,2,4},ytick={-1},
 ]
 \addplot[blue,samples=101,domain=-7:3] {-1/(x*(x-3))};
 \addplot[blue,-latex] coordinates {(3,-1) (5,-1) (7,-3)};
 \draw[fill=white] (3,-1) circle (1.5pt);
 \draw[fill] (5,-1) circle (1.5pt);
 \draw (3,4) -- (3,-4);
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Or something with more pi's to prepare for the upcoming pi day. (This is just to say that there are infinitely many similarly looking functions.)

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,width=12cm,height=7cm}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=$x$, ylabel=$y$,ymax=4,ymin=-4,unbounded coords=jump,
 axis lines=middle,title style={at={(1,1)},anchor=north east},
 title={$y=f(x)$},xtick={-2,0,2,4},ytick={-1},
 ]
 \addplot[blue,samples=51,domain=-7:-0.02] {-1/pow(abs(x),pi/2)};
 \addplot[blue,samples=31,domain=0:3] {pow(abs(x-1.5),pi)};
 \addplot[blue,-latex] coordinates {(3,-1) (5,-1) (8,-3)};
 \draw[fill=white] (3,-1) circle (1.5pt);
 \draw[fill] (5,-1) circle (1.5pt);
 \draw (3,4) -- (3,-4);
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.